DMG min/max into a real/integer

ashfall4

New Member
Reaction score
0
I am making a grid-based and partially turn-based DnD map and i am currently working on the attack system. I want to have the attacker face the attacked unit, play his attack animation, and (through a trigger) deal damage according to the unit's actual damage.

I have all but the part where it deals the damage. I cant find a way to set both the min and max dmg of the unit to two seperate variables:banghead:. Can anybody help me with this?

The trigger will set a random number between the min and max damage of the unit and damage the target by that number, playing the animation and making the unit face the attacked unit.

Note: I do not use JASS or any other alternative to the World Editor's trigger system.
 

hopy

Active Member
Reaction score
64
Well I'm sorry but I personally I don't think it's posible to do this.
The Minimum and Maximum damage is calculated by a base damage, an amount of dices, dice and the amount of sides on the dice.

Example: 10 base attack, 2 dice and 4 sides per dice.
Minimum damage: (Base + ((Amount of dice) x (minimum eyes the dice roll)). 10 + (2x1) = 12.
Maximum damage: (Base + ((Amount of dice) x (maximum eyes the dice roll)). 10 + (2x4) = 18.
Now, I looked around a bit and from what I know there isn't a way to detect a units Damage Number of Dice or Damage Sides per Dice value, atleast not using GUI.. I have no clue if it would be posible with Jazz and I'm expecting a "Jazz is not magic" reply...

The only sollutions that I can think of is either:
- Give all units 1 dice with 1 side.
- Make a trigger for each unit.

I doubt it but who knows, maybe http://www.thehelper.net/forums/showthread.php?t=137957 could be usefull incase you cant think of a alternative and you need this for something.
 

ashfall4

New Member
Reaction score
0
I thought so. Thank you for replying so quickly. I have another method in mind, so I dont think i'll be using the method you suggested.
 

Bogrim

y hello thar
Reaction score
154
Use a Hashtable and create a "library" in your Map Initialization, using the unit's type as the key to accessing minimum and maximum damage. You will have to manually add the minimum and maximum values for every unit, but it will also enable you to load the values using the hashtable at any time. For example:
Trigger:
  • Actions
    • Set Temp_Type = Footman
    • Custom script: set udg_Temp_Integer = udg_Temp_Type
    • Hashtable - Save 12 as Min of Temp_Integer in MinMaxTable
    • Hashtable - Save 13 as Max of Temp_Integer in MinMaxTable

You'll have to update the values when the player researches an upgrade that increases the min and max damage values and calculate any additional damage from items, but it's still doable though time consuming.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top