|
Thread: Damage related to health Mod | |
|
Khadras
Famous Hero
|
posted July 21, 2016 07:45 AM |
|
|
Damage related to health Mod
I found a problem in Damage related to health Mod and i don't know how to solve it. I kindly ask if someone can show me how.
The problem is with damage calculation formula that sometimes results negative damage that makes enemy creatures grow in number. Arrow Towers give negative damage and some creatures too. I want to set that the result damage to be always positive and i don't erm so well and i don't know how. The code is made by XEvolution (Emanuel Ciobotaru) and was stripped and modified snippets from Sagamosa's Advanced Levels script.
!?MF1&1000; before damage dealt
!!BG:N?y-1; active stack?
!!BMy-1:B?y-2 N?y-3 H?y-4 L?y-5 I?y-99; original number of units / current number of units /HP/Hp lost by next monster
!!MF?y-60; original damage
!!VRy-10:Sy-2 *y-4; initial HP pool
!!VRy-11:Sy-3 *y-4 -y-5; actual HP pool after damage
!!VRy-52:Sy-11 : y-10; lost hp ratio
!!VRy-53:S1;
!!VRy-54:Sy-53 - y-52;
!!VRy-56:Sy-2 - y-3; number of lost uits
!!VRy-55:Sy-54 * y-56 : 2;
!!VRy-62:Sy-60 - y-55; modified damage
!!VRv4567:Sy-55; difference of damage
!!MF:Fy-62; deal new updated damage
!!VRz-1&v4567>0:S^Stack's enjury reduced its damage with %Y-55 from %Y-60^;
!!BU:Mz-1;
The minimum group damage must be 1, not 0 or negative. y-62 variable must be always positive. I don't know how to set y-62 >= 1. Please help me because this mod is very useful for me and it is an interesting mod.
|
|
Salamandre
Admirable
Omnipresent Hero
Wog refugee
|
posted July 21, 2016 08:34 AM |
|
|
Try this?
!?MF1&1000; before damage dealt
!!BG:N?y-1; active stack?
!!BMy-1:B?y-2 N?y-3 H?y-4 L?y-5 I?y-99; original number of units / current number of units /HP/Hp lost by next monster
!!MF:D?y-60; original damage
!!VRy-10:Sy-2 *y-4; initial HP pool
!!VRy-11:Sy-3 *y-4 -y-5; actual HP pool after damage
!!VRy-52:Sy-11 : y-10; lost hp ratio
!!VRy-53:S1;
!!VRy-54:Sy-53 - y-52;
!!VRy-56:Sy-2 - y-3; number of lost uits
!!VRy-55:Sy-54 * y-56 : 2;
!!VRy-62:Sy-60 - y-55; modified damage
!!VRy-62&y-62<1:S1;
!!VRv4567:Sy-55; difference of damage
!!MF:Fy-62; deal new updated damage
!!VRz-1&v4567>0:S^Stack's enjury reduced its damage with %Y-55 from %Y-60^;
!!BU:Mz-1;
|
|
Khadras
Famous Hero
|
posted July 21, 2016 10:36 AM |
|
|
Salamandre said: Try this?
!?MF1&1000; before damage dealt
!!BG:N?y-1; active stack?
!!BMy-1:B?y-2 N?y-3 H?y-4 L?y-5 I?y-99; original number of units / current number of units /HP/Hp lost by next monster
!!MF:D?y-60; original damage
!!VRy-10:Sy-2 *y-4; initial HP pool
!!VRy-11:Sy-3 *y-4 -y-5; actual HP pool after damage
!!VRy-52:Sy-11 : y-10; lost hp ratio
!!VRy-53:S1;
!!VRy-54:Sy-53 - y-52;
!!VRy-56:Sy-2 - y-3; number of lost uits
!!VRy-55:Sy-54 * y-56 : 2;
!!VRy-62:Sy-60 - y-55; modified damage
!!VRy-62&y-62<1:S1;
!!VRv4567:Sy-55; difference of damage
!!MF:Fy-62; deal new updated damage
!!VRz-1&v4567>0:S^Stack's enjury reduced its damage with %Y-55 from %Y-60^;
!!BU:Mz-1;
Thank you very much! You saved me. :)
|
|
Jamal1
Tavern Dweller
|
posted September 23, 2020 06:41 PM |
|
|
When choosing a product, the main criteria are health protection and comfort. You should also pay attention to the price: patients who know firsthand about the problems caused by a sedentary lifestyle will not save on their health. The cheapest wheelchair cushion is made of latex or foam rubber, gel cushions are slightly more expensive, but the most comfortable ones can be found at [url=https://communityclinicassociation.org/roho-wheelchair-cushion/]Roho[/url]. The highest price tag for products made of polyurethane or combined
____________
|
|
Khadras
Famous Hero
|
posted September 24, 2020 07:06 PM |
|
|
Jamal1 said: When choosing a product, the main criteria are health protection and comfort. You should also pay attention to the price: patients who know firsthand about the problems caused by a sedentary lifestyle will not save on their health. The cheapest wheelchair cushion is made of latex or foam rubber, gel cushions are slightly more expensive, but the most comfortable ones can be found at Roho. The highest price tag for products made of polyurethane or combined
??
|
|
FirePaladin
Promising
Legendary Hero
DoR Modder
|
posted September 24, 2020 07:11 PM |
|
|
It's a bot, again.
____________
Enshackling time itself, heralds of the Ancients among their heat-depleted land.... Who could they be, who could rally the beings of the East and the North and control the mortals' fate?
|
|
Khadras
Famous Hero
|
posted September 14, 2022 05:54 AM |
|
Edited by Khadras at 06:33, 14 Sep 2022.
|
Hi everyone!
I think about a modification of this mod names Moral Related to Health (or to Loss), where the morale and luck of all unit stacks are decreased or raised depending on hero lost units or enemy hero lost units. Total health lost by the hero affects the morale and luck of all his units, and total health lost by the enemy hero raises the morale and luck of the hero. Morale and luck can be negative, so it is not the same problem as it did with damage in Damage Related to Health.
I think only morale must be modified. The morale must raise or decrease by 1 for every 20% of army total health lost by the enemy hero or the current hero. How about luck? The percentage can be calculated in two variants: army total health lost or the total number of units lost. If this is calculated using the total number of units lost by the hero, then the player is tended to hire only the strongest units.
Some ideas on how this idea can be implemented?
|
|
RerryR
Promising
Supreme Hero
Researching Magic
|
posted September 14, 2022 07:50 AM |
|
|
Khadras said: Hi everyone!
I think about a modification of this mod names Moral Related to Health (or to Loss), where the morale and luck of all unit stacks are decreased or raised depending on hero lost units or enemy hero lost units. ...
Some ideas on how this idea can be implemented?
To change Morale and Luck during combat, you must set them again after every battle action of the creatures and at the beginning of the fight.
In the GEM Mod there's example how it could work:
Fix the Luck and Morale bug from 8th level creatures in WoG (by PerryR)
!?FU(OnSetupBattlefield)&1000/i^battle_isQuick^=(FALSE);
!!FU(Set_Morale_and_Luck)i^battle_hero_0^/i^battle_hero_1^/0;
!?FU(OnCombatRound)&1000/i^battle_isQuick^=(FALSE);
!!FU(Set_Morale_and_Luck)i^battle_hero_0^/i^battle_hero_1^/1;
!?FU(OnAfterBattleAction)&1000/i^battle_isQuick^=(FALSE);
!!FU(Set_Morale_and_Luck)i^battle_hero_0^/i^battle_hero_1^/1;
!?FU(Set_Morale_and_Luck);
....
|
|
Khadras
Famous Hero
|
posted September 14, 2022 08:19 AM |
|
|
|
|