You basically have two sources of inflicting damage -
and
插入代码块:
agent_deliver_damage_to_agent
. There are also ways of catching when projectiles are emitted or hit stuff - they are
ti_on_weapon_attack (when you shoot a gun),
ti_on_missile_hit (when an ammo hits something),
ti_on_scene_prop_hit (prop is hit),
ti_on_agent_hit (agent is hit). The most straightforward way of making use of these triggers is to define a special cannon ammo and then use
ti_on_missile_hit to catch it. Then, find agents within a certain distance of the missile and inflict damage with
插入代码块:
agent_deliver_damage_to_agent
. While randomizing added shrapnel is more realistic, it's slightly more complicated and combining the two will probably be more satisfactory.