Welcome to the Builder Academy

Question Player special problem

More
01 Feb 2018 07:20 - 01 Feb 2018 07:20 #7501 by JTP
Replied by JTP on topic Player special problem
Changed to -=

I now went from a bone armor start of 128 Down to 71
After mob hit me only for 27


And Im still missing until bone armor ends.
Last edit: 01 Feb 2018 07:20 by JTP.

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

More
01 Feb 2018 07:21 #7502 by Fizban
Replied by Fizban on topic Player special problem
Code:
if(affected_by_spell(victim, SPELL_BONE_ARMOR)) { bone_armor_rem = victim->player_specials->saved.bone_armor_hp - dam; // BONE ARMOR ADJUSTMENT HERE if(bone_armor_rem > 0) { // bone armor takes all of the damage and is still valid victim->player_specials->saved.bone_armor_hp = bone_armor_rem; dam = 0; send_to_char(victim, "Bone Armor At: %d\r\n", victim->player_specials->saved.bone_armor_hp); } else { victim->player_specials->saved.bone_armor_hp = 0; dam -= bone_armor_rem; affect_from_char(victim, SPELL_BONE_ARMOR); send_to_char(victim, "Your bone armor has worn out.\r\n"); } // END BONE ARMOR ADJUSTMENT }

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

More
01 Feb 2018 07:25 #7503 by WhiskyTest
Replied by WhiskyTest on topic Player special problem
That looks better, the old ch/victim switcharoo!

Question:
Code:
bone_armor_rem = victim->player_specials->saved.bone_armor_hp - dam;
Does this line leave bone_armor_hp reduced by dam as well as setting a value for bone_armor_rem ?

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

More
01 Feb 2018 07:37 #7504 by JTP
Replied by JTP on topic Player special problem
When i try your victim sulution, Then mob missed me until bone armor is gone. And the bone armor is redused each miss mob makes on me.


So it just reversed it all it Seems

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

More
01 Feb 2018 07:39 - 01 Feb 2018 07:44 #7505 by Fizban
Replied by Fizban on topic Player special problem
Seems that's not going to work right on the last hit, but will till then.

Sanity checking shows this it was actually right before whisky's suggestion.

Damage = 160
Bone armor = 150

bone_armor_rem = victim->player_specials->saved.bone_armor_hp - dam;

150 - 160 = -10

bone_armor_rem = -10

dam -= bone_armor_rem;

That would actually make you take 10 more damage than if you never had bone armor.

dam = -bone_armor_rem; makes you take 10 damage, so pretty sure you actually do want that line put back how it was originally, but you did have victim and ch switched.
Last edit: 01 Feb 2018 07:44 by Fizban.

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

More
01 Feb 2018 07:43 #7506 by Fizban
Replied by Fizban on topic Player special problem

JTP wrote: When i try your victim sulution, Then mob missed me until bone armor is gone. And the bone armor is redused each miss mob makes on me.


So it just reversed it all it Seems


Isn't that it working as intended?

Pretty sure a hit that does 0 damage generates a miss message.

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

Time to create page: 0.212 seconds