Welcome to the Builder Academy

Question simple_list resets itself

More
26 Dec 2016 22:01 - 02 Jan 2017 21:20 #6467 by JTP
To give the fly spell more meaning, what are the different places to look, if i wanted to try add half move cost when affected by fly, moving through the different terrain types ?


Also i would like a certain class to every 5 levels automatic gain hitroll/damroll and ac without wearring gear ? Where could that be done ?
Last edit: 02 Jan 2017 21:20 by JTP.

Please Log in or Create an account to join the conversation.

More
27 Dec 2016 02:34 - 27 Dec 2016 02:36 #6468 by Liko
Replied by Liko on topic AFF FLYING

JTP wrote: To give the fly spell more meaning, what are the different places to look, if i wanted to try add half move cost when affected by fly, moving through the different terrain types ?


Also i would like a certain class to every 5 levels automatic gain hitroll/damroll and ac without wearring gear ? Where could that be done ?


Open act.movement.c and search need_movement. Under need_movement add:
Code:
if (AFF_FLAGGED(ch, AFF_FLYING)) { need_movement /= 2; }

2. class.c is where leveling is handled. I would program something like that in advance_level

Randian(0.0.0)
Owner/Developer
Last edit: 27 Dec 2016 02:36 by Liko.

Please Log in or Create an account to join the conversation.

More
27 Dec 2016 17:04 - 27 Dec 2016 17:18 #6469 by JTP
Replied by JTP on topic AFF FLYING
Ok i tried adding it here under advance_level, it Works when leveling up, BUT it sets the numbers to a number, then when people have eq on that also adds hitroll/damroll/ac while leveling from 6-7 and remove it, they suddently have -3 damroll, and mess it all up.

Any thoughts on what i need to do better ? Cant keep walking around naked for it to Work :)
Code:
case CLASS_*****: add_hp += rand_number(8, 14); add_mana = 0; add_move = rand_number(1, 3); if (GET_LEVEL(ch) >=1 && GET_LEVEL(ch) <= 6) { GET_HITROLL(ch) = 1; GET_AC(ch) = 95; } if (GET_LEVEL(ch) >=7 && GET_LEVEL(ch) <= 12) { GET_HITROLL(ch) = 1; GET_DAMROLL(ch) = 1; GET_AC(ch) = 90; } break;
Last edit: 27 Dec 2016 17:18 by JTP.

Please Log in or Create an account to join the conversation.

More
27 Dec 2016 17:44 - 27 Dec 2016 17:55 #6470 by JTP
Replied by JTP on topic AFF FLYING
I also tried:
Code:
{ if (GET_LEVEL(ch) >=1 && GET_LEVEL(ch) <= 6) { GET_HITROLL(ch) = 1; } if (GET_LEVEL(ch) >=7 && GET_LEVEL(ch) <= 12) { GET_DAMROLL(ch) += 1; } if (GET_LEVEL(ch) >=13 && GET_LEVEL(ch) <= 18) { GET_HITROLL(ch) += 1; } if (GET_LEVEL(ch) >=19 && GET_LEVEL(ch) <= 24) { GET_DAMROLL(ch) += 1; } if (GET_LEVEL(ch) >=25 && GET_LEVEL(ch) <= 30) { GET_HITROLL(ch) += 1; } if (GET_LEVEL(ch) >=31 && GET_LEVEL(ch) <= 36) { GET_DAMROLL(ch) += 1; } if (GET_LEVEL(ch) >=37 && GET_LEVEL(ch) <= 42) { GET_HITROLL(ch) += 1; } if (GET_LEVEL(ch) >=43 && GET_LEVEL(ch) <= 48) { GET_DAMROLL(ch) += 1; } if (GET_LEVEL(ch) >=49 && GET_LEVEL(ch) <= 50) { GET_HITROLL(ch) += 1; } }

This seems to Work for the hitroll and damroll...but if i try lower AC it is messed after having gear on and leveling and then removing gear, ends up with ac of 108.

Only problems with above code for hitroll and damroll is if i advance the test char, then it adds for every level. Ending up with ALOT haha.

But leveling up on its own it Works.


Ideas welcome to improve it and also add lowering AC
Last edit: 27 Dec 2016 17:55 by JTP.

Please Log in or Create an account to join the conversation.

More
27 Dec 2016 22:24 #6471 by thomas
Replied by thomas on topic AFF FLYING
You are onto something. Avoid directly setting the AC, hitroll and damroll, ie. don't use "GET_HITROLL(ch) = 1" because this is what's getting you into trouble.

Some things to note up front:
You might not want to give bonuses on every level up - this will eventually lead to some really OP characters.
Hitroll and damroll bonuses are better when getting higher.
AC is better when getting lower.


I would perhaps do something like this:
Code:
+int class_xxx_level_bonus[][3] = { +// HR, DR, AC + {1, 0, 0}, + {0, 0, -5}, + {0, 1, 0}, + {1, 0, 0}, + {0, 0, -5}, + {0, 1, 0}, + {1, 0, 0}, + {0, 0, -5}, + {0, 1, 0}, + {1, 0, 0}, + {0, 0, -5}, + {0, 1, 0}, + {1, 0, 0}, + {0, 0, -5}, + {0, 1, 0}, + {1, 0, 0}, + {0, 0, -5}, + {0, 1, 0} // expand until you have MAX_LEVEL lines. +}; /* This function controls the change to maxmove, maxmana, and maxhp for each * class every time they gain a level. */ void advance_level(struct char_data *ch) { int add_hp, add_mana = 0, add_move = 0, i; add_hp = con_app[GET_CON(ch)].hitp; switch (GET_CLASS(ch)) { + case CLASS_XXX: + add_hp += rand_number(10, 15); + add_mana = 0; + add_move = rand_number(1, 3); + GET_HITROLL(ch) += class_xxx_level_bonus[GET_LEVEL(ch)][0]; + GET_DAMROLL(ch) += class_xxx_level_bonus[GET_LEVEL(ch)][1]; + GET_AC(ch) += class_xxx_level_bonus[GET_LEVEL(ch)][2]; + break; case CLASS_MAGIC_USER:
note how this uses += everywhere? This means that the correct value will be saved in the player files, after subtracting/adding anything the player is wearing or affected by.

Please Log in or Create an account to join the conversation.

More
27 Dec 2016 22:40 - 28 Dec 2016 01:03 #6472 by JTP
Replied by JTP on topic AFF FLYING
Just tested it, max character ended up with ac 55 and hitroll 4 and damroll 5

Should have been 50 +5 +5...ponder ponder, just double checked over the levels it adds +1 hitroll 5 times, and +1 damroll 5 times...for ac -5 10 times.


Though the good news is that it Works with gear on when advancing, then removed gear and it was still ac 55 +4 +5

Just dunno why its not 50 +5 +5



// HR, DR, AC
{1, 0, -5}, <<<---maybe first line is regarded as lvl 0 ? and is not added ? It would explain the missing +1 hitroll and -5 ac. Or any other idea ?
Last edit: 28 Dec 2016 01:03 by JTP.

Please Log in or Create an account to join the conversation.

Time to create page: 0.285 seconds