Create an enemy¶
| Prefab | Type | Notes |
|---|---|---|
Spider |
Melee | Fast; weak to melee and shotgun |
OrcBrute |
Melee | Resists melee and pistol |
SkeletonArquebusier |
Ranged | Weak to shotgun and explosion |
MageBoss |
Boss | Summons minions; starts inactive |
MageBossMinion |
Minion | Crow summoned by the boss |
Prefabs/Enemy/Variants holds AI variants that change only behavior and kit: OrcBrute_Brute (surrounds), SkeletonArquebusier_Gunner, _Heavy (charged attack) and _Skirmisher (retreats and shoots).
Warning
Keep the prefab hierarchy (EnemyRoot > Sprite > BulletSpawn/EnemyUI, Colliders > Body) and Animator state names. They are part of the contract.
Create the enemy¶
- Duplicate the closest prefab (melee:
OrcBrute; ranged:SkeletonArquebusier). - On
EnemyEntity, set the name (Enemytable key), classification (Standard/Boss/Minion), health, resistances, Start Inactive (ambushes, bosses), sounds and loot. - On
EnemyBrain, setbehaviour(Enemy AI), aggro range andattackOptions. Without attack options the enemy never attacks. - Replace sprites and clips in
<Enemy>.overrideController(Sprites and animation). - Optionally add phases or summoning (Ambushes and bosses).
- Add the name to the
Enemylocalization table, place it (one per cell) and save the scene to generate itsmapId.
Set up the attack kit¶
Each EnemyAttackOption has a profile (TurnWeaponProfile in Data/Enemy/TurnProfiles), animationState (empty = Attack), useChancePercent (on failure, the next option is tried), cooldownTurns, a cell range, and optional charging (isCharged, chargeTurns, cancelOnDamage).
An attack fires only when the player is on the same row or column and is the first actor in line. The hit lands at the profile's ImpactNormalized (0 = clip start, 1 = last frame).
Set weaknesses and resistances¶
In Combat Settings, map each DamageType to a multiplier: 0 = immune, <1 = resistant, 1 or missing = normal, >1 = weak. Current values:
| Prefab | Melee | Pistol | Rifle | Shotgun | Plasma | Explosion |
|---|---|---|---|---|---|---|
SkeletonArquebusier |
1.25 | 0.75 | 0.75 | 1.5 | 1.5 | |
OrcBrute |
0.75 | 0.75 | 1.25 | 1.5 | ||
Spider |
1.25 | 1.25 | 0.75 | |||
MageBoss |
1.25 | 0.5 | 0.75 | |||
MageBossMinion |
1.25 | 1.25 | 0.75 |
Health and damage also scale with difficulty by classification.
Adjust the visuals¶
EnemySpriteOffsetpulls the sprite toward an adjacent player (offsetInCells, default 0.25) and lunges on melee (lungeInCells, default 0.15). Tall enemies need smaller values (OrcBrute,SkeletonArquebusier: 0.15).- Keep the
EnemyUIcanvas about 15 cm above the head at world scale 0.01. PutBulletSpawnat the weapon tip.
Scenes need GridMap, TurnManager, Player, a MainCamera, LevelCore/LevelWorldTracker (medals, checkpoints) and GameObjectPoolManager (blood).