summon_weapon ![code/game/objects/items/summon.dm 229](git.png)
A singular summoned object
How summon weapons work:
Reset() - makes it go back to its master. Target() - locks onto a target for a duration
The biggest challenge is synchronizing animations. Variables keep track of when things tick, but, animations are client-timed, and not server-timed
Animations: The weapon can only track its "intended" angle and dist "Current" pixel x/y are always calculated relative to a target from the current orbiting atom the physical effect is on There's 3 animations, MoveTo(location, angle, dist, rotation) Orbit(location) Rotate(degrees)
And an non-animation that just snaps it to a location, HardReset(location)
Vars | |
angle | current angle from victim - clockwise from 0. null if not attacking. |
---|---|
angle_vary | rand dist to rotate during reattack phase |
animation_lock | animation locked until |
animation_timerid | animation lock timer |
appearance | mutable_appearance to use, will skip making from icon/icon state if so |
atom | the actual effect |
attack_damage | attack damage |
attack_length | attack length in deciseconds - this is the attack animation speed in total |
attack_sound | attack sound |
attack_speed | attack delay in deciseconds - this is time spent between attacks |
attack_type | attack damtype |
attack_verb | attack verb |
dist | current distance from victim - pixels |
host | host |
icon | icon file |
icon_state | icon state |
name | name |
orbit_dist | orbit distance from victim - pixels |
orbit_dist_vary | orbit distance variation from victim |
reset_speed | reset animation duration |
reset_timerid | reset timerid |
rotation | current rotation - angles clockwise from north |
state | current state |
victim | currently locked attack target |
Procs | |
MoveTo | relative to defaults to current location |
Rotate | rotation defaults to facing towards locked atom |
Var Details
angle ![code/game/objects/items/summon.dm 245](git.png)
current angle from victim - clockwise from 0. null if not attacking.
angle_vary ![code/game/objects/items/summon.dm 251](git.png)
rand dist to rotate during reattack phase
animation_lock ![code/game/objects/items/summon.dm 281](git.png)
animation locked until
animation_timerid ![code/game/objects/items/summon.dm 283](git.png)
animation lock timer
appearance ![code/game/objects/items/summon.dm 239](git.png)
mutable_appearance to use, will skip making from icon/icon state if so
atom ![code/game/objects/items/summon.dm 241](git.png)
the actual effect
attack_damage ![code/game/objects/items/summon.dm 261](git.png)
attack damage
attack_length ![code/game/objects/items/summon.dm 259](git.png)
attack length in deciseconds - this is the attack animation speed in total
attack_sound ![code/game/objects/items/summon.dm 267](git.png)
attack sound
attack_speed ![code/game/objects/items/summon.dm 257](git.png)
attack delay in deciseconds - this is time spent between attacks
attack_type ![code/game/objects/items/summon.dm 265](git.png)
attack damtype
attack_verb ![code/game/objects/items/summon.dm 272](git.png)
attack verb
dist ![code/game/objects/items/summon.dm 247](git.png)
current distance from victim - pixels
host ![code/game/objects/items/summon.dm 233](git.png)
host
icon ![code/game/objects/items/summon.dm 235](git.png)
icon file
icon_state ![code/game/objects/items/summon.dm 237](git.png)
icon state
name ![code/game/objects/items/summon.dm 231](git.png)
name
orbit_dist ![code/game/objects/items/summon.dm 253](git.png)
orbit distance from victim - pixels
orbit_dist_vary ![code/game/objects/items/summon.dm 255](git.png)
orbit distance variation from victim
reset_speed ![code/game/objects/items/summon.dm 263](git.png)
reset animation duration
reset_timerid ![code/game/objects/items/summon.dm 287](git.png)
reset timerid
rotation ![code/game/objects/items/summon.dm 249](git.png)
current rotation - angles clockwise from north
state ![code/game/objects/items/summon.dm 279](git.png)
current state
victim ![code/game/objects/items/summon.dm 243](git.png)
currently locked attack target
Proc Details
MoveTo
relative to defaults to current location
Rotate
rotation defaults to facing towards locked atom