Welcome to the Builder Academy

Question Player special problem

More
01 Feb 2018 07:52 #7507 by JTP
Replied by JTP on topic Player special problem
The mob still missed my testchar until bone armor ended..

This time How ever, it didnt reduce the bone armor every miss, only maybe every 5th miss, and Then only by 2 hp

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

More
01 Feb 2018 08:00 #7508 by JTP
Replied by JTP on topic Player special problem
Ahh your right, 0 Dam is a miss

But now it updates bone armor at between my hit and mobs hit, making me think, its still my damage that reduces it ?

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

More
01 Feb 2018 08:00 #7509 by Fizban
Replied by Fizban on topic Player special problem
That seems as intended.

"True" misses, ie. hits that were going to do 0 damage anyway, will still miss, but not reduce bone armor.

Hits that were going to hit will reduce bone armor. They will then generate miss messages as well due to them doing 0 damage.

A mob that truly missed more likely had lower strength, and thus would have done less damage on its attacks as well, so less being removed from bone armor makes sense.
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 }

That dam = line near the bottom should be the way it is in this post, and the way you had it originally, not the way you changed it to after whisky's post, but aside from that I don't see anything suggesting that that wouldn't be working as expected.

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

More
01 Feb 2018 08:04 #7510 by WhiskyTest
Replied by WhiskyTest on topic Player special problem
what is the dam = -bone_armor_rem part doing?

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

More
01 Feb 2018 08:13 #7511 by JTP
Replied by JTP on topic Player special problem
But showing bone armor at:

Between my attack and mobs attack, just seems Odd.
It should Update After mobs hit.

I cant Seem to be able to upload a new picture

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

More
01 Feb 2018 13:04 #7512 by Fizban
Replied by Fizban on topic Player special problem

WhiskyTest wrote: what is the dam = -bone_armor_rem part doing?


It should set dam to the inverse of remaining bone armor.

If you have 150 bone armor left, and you get hit for 160.

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

-10 = 150 - 160

dam = -(-10)

dam = 10

That seems as intended.

As for the message, I'm pretty sure it it is sending it "when" you get hit, but since it's being sent when the amount you're getting hit for is being calculated as opposed to after being shown how much you're getting hit for it's showing how much bone armor you will have left after a hit, and then showing the hit that reduced it to that much immediately after.

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

Time to create page: 0.220 seconds