Combat Actions and Spells

From Worldbox Wiki

Combat and spell actions require different things to be used by units and there are specific conditions in which units might try to use them.

Attacking[edit]

Attack Type[edit]

When units attack the game will figure out what basic combat actions units will perform:

  • If units have spells, don't have Silence or Spell Recovery status, and not possessed: They are able to use spells
  • If units have a melee attack: They are able to use melee attacks
  • If units don't have melee attack: They are able to use ranged attacks

Performing Attacks[edit]

  • The game will choose a random attack type. Units can perform up to two different attack types:
    • Melee or Spell
    • Ranged or Spell
  • Spells are only chosen 33.3% of the time why the other attack type (melee or ranged) is chosen 66.6% of the time. If the spell attack type is chosen the game will chose a random spell if the attacking unit has multiple spells they can use.
  • If units use a spell they will then perform a basic attack (melee or ranged), spells for combat can not be used if the unit has the File:Religion trait cast silence.png Silence status effect
  • Units have 50% chance to lose 1 nutrition (hunger) after attacking
  • Units will be pushed back by recoil if their weapon has any

Using Combat Actions[edit]

Combat actions must go through multiple conditions before units area able to them in battle. Except for simpler actions like basic melee and ranged attacks which mostly depend on what item weapons hold (or lack of one).

  • File:Icon gene attack610x.pngOffensive Actions:
    • If target is not within the units range, they will try to dash toward the target. They will need the File:IconSkillDash.pngDash trait to do this
    • If target is within range and unit is able to perform ranged attacks but still isn't able to attack, they will try to backstep, throw a bomb, or throw a torch They will need the Backstep, File:IconGrenade10x.pngBomberman, or File:IconPyromaniac10x.pngPyromaniac trait to do this
  • Defensive Actions:
    • First, try to deflect the attack. They will need the Deflect Projectile trait to do this
    • Second, try to block the attack. They will need the File:IconSkillBlock10x.pngBlock trait to do this and the attack will need to be a blockable projectile (arrows, snowballs, rocks, shotgun bullets, bones)
    • Third, try to dodge the attack. They will need the Dodge trait to do this
  • If units have the Slow trait or File:IconRecoveryCombatAction.pngCombat Action Recovery status they cannot use advanced combat actions
  • The game will check for action specific limitations (see the combat actions table below). This also includes stamina requirements
  • If a unit ends up having multiple valid combat actions then the game will choose a random action
  • Every combat action has a "Combat Chance" when units try to use them. For all actions this is equal to 20%
    • If the "Combat Chance" is successful units spend stamina, get the File:IconRecoveryCombatAction.pngCombat Action Recovery status, and use the selected combat action
    • If it fails then they don't use the selected combat action
  • Units can have their "Combat Chance" increased in various ways:

Combat Actions[edit]

= Stamina required to use,File:IconClock10x.png = Cooldown (in seconds), File:IconDice10x.png= Combat Chance, = Plays an attack sound when used

Icon Action Effect File:IconClock10x.png File:IconDice10x.png
Melee Attack Attacks without projectiles (usually close range), uses attacker's damage stat to calculate damage dealt - 1 - Yes
Ranged Attack Attacks with projectiles (usually long range), uses attacker's damage stat to calculate damage dealt
In most instances an item is required for units to perform a ranged attack. Some items allow units to shoot more than one projectile at once
The way accuracy and projectile path is calculated is quite complicated and would be messy to explain:
  • If you want to read directly from the code see "attackRangeAction()" in the "CombatActionLibrary"
  • The accuracy stat has a strong effect on projectile accuracy. Accuracy for all units is equal to 1 except for Arrows boats which have 4 accuracy
  • The game calculates accuracy for each projectile fired. So, if a unit can fire multiple projectiles at once some may end up be more accurate then others
  • If a unit has a bigger (size * scale) stat then they can be hit from a closer range
- 1 - Yes
File:IconMana10x.png Cast Spell Fore more info on specific spells see the Spell Action table below
Uses a spell:
  • The unit will decide a random spell to use from the spells they are able to cast
  • File:IconMana10x.pngIf the unit does not have enough mana to cast the randomly selected spell then the action cancels
  • The game will then calculate the spell's chance of success. A unit's spellcasting stat increases the chance of success
  • If the spell is meant for buildings and the unit's target isn't a building then the spell fails
  • If the spell is meant for a creature and the unit's target is a building then the spell fails
  • If the spell has a health ratio and that ratio is equal to or less than the caster's health ratio then the spell fails
  • If the spell has a minimum distance that the caster is closer to the target than that minimum distance then the spell fails
  • If the spell succeeds after this point then it is caster and the caster gets the Spell Recovery status effect
5 1 20% Yes
Deflect Projectile Used before a unit gets hit with an attack
Reflects an attack back at their attacker and takes no damage, unit will stop moving when deflecting the attack
5 1 20% No
File:IconSkillBlock10x.png Block Used when a blockable projectile is going to hit a unit if it wasn't deflected (arrows, snowballs, rocks, shotgun bullets, bones)
Projectile bounces away from them, taking no damage
5 0.5 20% No
Dodge Used before a unit gets hit with an attack if it wasn't deflected or blocked
Moves out of the way of an attack, taking no damage (50% chance to dodge left or right). Gets the Dodge status effect after performing
Move Power = 3, Move Power Height = 1.5
5 1 20% No
File:IconSkillDash.png Dash File:Icon gene attack610x.pngUsed when their target is out of range and more than three tiles away
Moves toward their target in one quick movement. Gets the Dash status effect after performing
Move Power = 5, Move Power Height = 1.2
10 2 20% No
Backstep Used if unit is using a ranged attacks and their attack cooldown hasn't finished or the attack isn't possible for some reason but the target is within range. Fails if the distance squared from attacker and defender is less than 50% of the attacker's range squared (attacker is the one with the ranged attacks)
Moves backwards to avoid getting hit by the defender
Move Power = 5, Move Power Height = 1.2
10 1 20% No
File:IconGrenade10x.png Throw Bomb File:Icon gene attack610x.pngUsed when their target is out of range of normal attacks and more than three tiles away
Used if unit is using a ranged attacks and their attack cooldown hasn't finished or the attack isn't possible for some reason but the target is within range
Fails if the distance squared from attacker and defender is less than 36 or more than 2500 (the attacker is the one using the Throw Bomb action)
Throws a firebomb: 30 Damage, 12 Speed, Terraform Range = 2, starts fire, and has no affect on demons
30 8 20% No
File:IconPyromaniac10x.png Throw Torch File:Icon gene attack610x.pngUsed when their target is out of range of normal attacks and more than three tiles away
Used if unit is using a ranged attacks and their attack cooldown hasn't finished or the attack isn't possible for some reason but the target is within range
Fails if the distance squared from attacker and defender is less than 36 or more than 2500 (the attacker is the one using the Throw Bomb action)
Throws a torch: 25 Damage, 15 Speed, Terraform Range = 1, starts fire, and has no affect on demons
5 8 20% No
- Random Jump Unused action with no effect 5 2 - No

Using Spells[edit]

Spells are used when units have spells, aren't possessed, and are allowed to use spells.

When a unit attacks there is a 33.3% chance that they use a spell (see Attacks section at the top for more info). If there are multiple spells that units can use the game will choose one at random.

Uses a spell:

  • The unit will decide a random spell to use from the spells they are able to cast
  • File:IconMana10x.pngIf the unit does not have enough mana to cast the randomly selected spell then the action cancels
  • The game will then calculate the spell's chance of success. A unit's spellcasting stat increases the chance of success (spells have a base spellcasting stat of 10, 20, or 30%)
  • If the spell is meant for buildings and the unit's target isn't a building then the spell fails
  • If the spell is meant for a creature and the unit's target is a building then the spell fails
  • If the spell has a health ratio and that ratio is equal to or less than the caster's health ratio then the spell fails
  • If the spell has a minimum distance and the caster is closer to the target than that minimum distance then the spell fails
  • If the spell succeeds after this point then it is caster and the caster gets the Spell Recovery status effect

Spells[edit]

File:IconMana10x.png= Mana required to use, File:IconDice10x.png= Spell Chance, Health Ratio, Minimum Distance, Can be used in combat

Icon Spell Effects Unlock File:IconMana10x.png File:IconDice10x.png
Teleport Combat Action: Teleports to a random tile on a random island (cannot teleport onto mountains, summits, and walls)

File:IconBrain10x.pngUnlocks Decisions:
Teleporting: Teleports to a random tile on a random island (cannot teleport onto mountains, summits, and walls)
Cooldown = 20s, 30% chance to be successful, cannot teleport if not at full health
Teleporting Home: Teleports onto a random tile on a random zone in their home village
Cooldown = 60s, 30% chance to be successful, won't teleport if already on the same island the unit is on
File:Subspecies trait gift of void10x.pngGift of the Void
Teleport
File:IconChosenOne10x.pngThe Chosen One
15 30% 60% -
File:IconFire.png Cast Fire Combat Action: Spawns one fire particle on target and then three more near the target's tile (target can be a creature or building)

File:IconBrain10x.pngUnlocks Decisions:
Burning: If they find tumor tiles they will try to burn them
Cooldown = 10s, 50% chance to be successful
Gift of Fire
File:Religion trait cast fire.pngCast Fire
File:IconChosenOne10x.pngThe Chosen One
Evil Staff
File:Icon plague doctor staff scaled 10x.pngPlague Doctor Staff
3 20% - 3
Cast Blood Rain Combat Action: Casts blood rain on themself to heal

File:IconBrain10x.pngUnlocks Decisions:
Healing: If they find tumor tiles they will try to burn them
Cooldown = 5s, will not use if at full health
Gift of Harmony
File:Subspecies trait gift of blood10x.pngGift of Blood
File:Religion trait cast blood rain.pngCast Blood Rain
File:IconChosenOne10x.pngThe Chosen One
File:Icon white staff scaled 10x.pngWhite Staff
File:Icon druid staff scaled 10x.pngDruid Staff
2 30% 90% 0
Cast Curse Combat Action: Adds the Cursed status to their target if it isn't already cursed Gift of Death
File:Religion trait cast curse.pngCast Curse
File:IconChosenOne10x.pngThe Chosen One
Necromancer Staff
3 20% - 4
Cast Silence Combat Action: Adds the Silenced status to their target (prevents target from being able to use magic) File:Religion trait cast silence.pngSilence 5 20% - 6
File:Shielded10x.png Cast Shield Combat Action: Casts the Shielded status for 30 seconds on themself if they don't already have the status Gift of Water
File:Religion trait cast shield.pngBubble Shield
File:IconChosenOne10x.pngThe Chosen One
5 20% - -
File:IconLightning10x.png Summon Lightning Combat Action: Spawns medium lightning on their target (target can be a creature or building) Gift of Thunder
Summon Lightning
File:IconChosenOne10x.pngThe Chosen One
File:Icon white staff scaled 10x.pngWhite Staff
5 10% - 6
Summon Tornado Combat Action: Spawns a tornado that is 16.67% the size of a normal tornado on their target (target can be a creature or building) Gift of Air
File:Religion trait summon tornado.pngSummon Tornado
File:IconChosenOne10x.pngThe Chosen One
10 10% - 6
Spawn Skeleton Combat Action: Will spawn a skeleton if there isn't already more than 6 nearby

File:IconBrain10x.pngUnlocks Decisions:
Summoning: Will spawn a skeleton if there isn't already more than 6 nearby
Cooldown = 10s, 30% chance to be successful
Gift of Death
Summon Skeleton
File:IconChosenOne10x.pngThe Chosen One
Necromancer Staff
10 20% - 0
Cast Cure Combat Action: Cures their allies

File:IconBrain10x.pngUnlocks Decisions:
Curing: Cures their allies if they are on the solid ground and have curable traits or statuses
Cooldown = 15s, 30% chance to be successful
Gift of Harmony
File:Religion trait cast cure.pngCast Cure
File:IconChosenOne10x.pngThe Chosen One
3 30% - 0
File:IconFertilizerTrees10x.png Spawn Vegetation Combat Action: Spawns tree fertilizer

File:IconBrain10x.pngUnlocks Decisions:
Fertilizing: Spawns tree fertilizer
Cooldown = 10s, 30% chance to be successful, target must be a soil tile
File:Subspecies trait gift of life10x.pngGift of Life
File:Religion trait spawn vegetation.pngSpawn Vegetation
File:IconChosenOne10x.pngThe Chosen One
File:Icon druid staff scaled 10x.pngDruid Staff
5 10% - 0
Cast Grass Seeds Combat Action: Spawns grass biome seeds, doesn't work if Gaia's Covenant world law enabled File:Subspecies trait gift of life10x.pngGift of Life
File:Religion trait cast grass seeds.pngCreate Grass
File:IconChosenOne10x.pngThe Chosen One
4 10% - 0