- Joined
- Jul 14, 2011
- Messages
- 3,213
Hi!
I've spent some time doing this. I hope it's good enough for everyone to enjoy. It's fully made in JASS; but it's insanely commented, really easy to understand as well.
The system allows creating as many Damage types as you want (Fire, Earth, Physical, Pure, Psychic, Magical, Elemental, Nature, Wood, Composite, Magma, Stone, etc.) Also allows easily adding each unit a percentage resistance to each DamageType, and add a fixed resistance to each DamageType. Also allows handling Critical Strike, Critical Ratio, and Evasion.
Has a Global Boolean called IsHealed you can switch true/false at any time. True will mean that negative damage will heal units; false will make negative damage do nothing.
Has a Global Boolean called "ShownText" you can swithc true/false at any time. True will make damage popup as a floating text from target unit. If the unit is healed (IsHealed = true) the text will be green and will have a "+" before the amount. If It's false, nothing will be shown.
It's pretty easy to add a unit data:
That would add 12 Fire dmg, and 15% Fire resistance, and 6 Fire damage reduction to units of type 'xxxx'
That would add all units of type 'xxxx' 10% chance to do Damage*2 and 6% chance to evade.
It works exactly the same to add data to items.
That would add 22 fire damage, 10% fire resistance, 0 fire damage reduction to units that picks an item of type 'ofir'
That will give units that pick an item of type 'ofir' a 12% chance to deal 20% more damage on an attack, and 0% chance to evade.
Item effects are cummulative. If you pick 6 items that give 10% chance to do damage*2, and 5 evasion, the unit will have 60% chance to do Damage*12, and 30% evasion.
Also, The unit name and all the unit damages/resistances/stats are displayed in a Multiboard (Screenshot at the end). Any selected unit data will be shown in the Multiboard.
The Path for Damage/Armor icons in the Multiboard is really easy to set
And so on, untill all of the Damage Types has their own icon.
The System is pretty much explained inside the testmap and script comments. In fact, I think there are more comments than system scripts.
PD: It's the first time is create a system like this one, I didn't find anywhere else to post for review or public check.
<< EDIT 22/09/2012 >>
· Credits to Adiktuz for most suggestion.
· Added Critical Chance, Critical Ratio, and Evasion.
· Made all UnitType data be applied to the UnitID when enters the map.
· Separated most of Core Functions into a library
· Improved code generally
· Updated Multiboard to fit new features
I've spent some time doing this. I hope it's good enough for everyone to enjoy. It's fully made in JASS; but it's insanely commented, really easy to understand as well.
The system allows creating as many Damage types as you want (Fire, Earth, Physical, Pure, Psychic, Magical, Elemental, Nature, Wood, Composite, Magma, Stone, etc.) Also allows easily adding each unit a percentage resistance to each DamageType, and add a fixed resistance to each DamageType. Also allows handling Critical Strike, Critical Ratio, and Evasion.
Has a Global Boolean called IsHealed you can switch true/false at any time. True will mean that negative damage will heal units; false will make negative damage do nothing.
Has a Global Boolean called "ShownText" you can swithc true/false at any time. True will make damage popup as a floating text from target unit. If the unit is healed (IsHealed = true) the text will be green and will have a "+" before the amount. If It's false, nothing will be shown.
It's pretty easy to add a unit data:
JASS:
call SpartDSAddUnitDmg('xxxx', SpartDSFire, 12, 0.15, 6)
JASS:
call SpartDSAddUnitStat('xxxx', 10, 2, 6)
It works exactly the same to add data to items.
JASS:
call SpartDSAddItemDmg('ofir', Fire, 22, .1, 0)
JASS:
call SpartDSAddItemStat('ofir', 12, 1.2, 0)
Item effects are cummulative. If you pick 6 items that give 10% chance to do damage*2, and 5 evasion, the unit will have 60% chance to do Damage*12, and 30% evasion.
Also, The unit name and all the unit damages/resistances/stats are displayed in a Multiboard (Screenshot at the end). Any selected unit data will be shown in the Multiboard.
The Path for Damage/Armor icons in the Multiboard is really easy to set
JASS:
set IconPath[SpartDS_Fire] = "ReplaceableTextures\\CommandButtons\\BTNOrbOfFire.blp"
set IconPath[SpartDS_Water] = "ReplaceableTextures\\CommandButtons\\BTNSummonWaterElemental.blp"
set IconPath[SpartDS_Wind] = "ReplaceableTextures\\CommandButtons\\BTNCyclone.blp"
set IconPath[SpartDS_Earth] = "ReplaceableTextures\\CommandButtons\\BTNEarthquake.blp"
set IconPath[SpartDS_Electric] = "ReplaceableTextures\\CommandButtons\\BTNChainLightning.blp"
The System is pretty much explained inside the testmap and script comments. In fact, I think there are more comments than system scripts.
PD: It's the first time is create a system like this one, I didn't find anywhere else to post for review or public check.
<< EDIT 22/09/2012 >>
· Credits to Adiktuz for most suggestion.
· Added Critical Chance, Critical Ratio, and Evasion.
· Made all UnitType data be applied to the UnitID when enters the map.
· Separated most of Core Functions into a library
· Improved code generally
· Updated Multiboard to fit new features
Attachments
Last edited: