-
-
Notifications
You must be signed in to change notification settings - Fork 452
/
illusion.dm
76 lines (65 loc) · 1.97 KB
/
illusion.dm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/mob/living/simple_animal/hostile/illusion
name = "illusion"
desc = "It's a fake!"
icon = 'icons/effects/effects.dmi'
icon_state = "static"
icon_living = "static"
icon_dead = "null"
gender = NEUTER
mob_biotypes = NONE
melee_damage_lower = 5
melee_damage_upper = 5
combat_mode = TRUE
attacktext = "gores"
maxHealth = 100
health = 100
speed = 0
faction = list("illusion")
var/life_span = INFINITY //how long until they despawn
var/mob/living/parent_mob
var/multiply_chance = 0 //if we multiply on hit
del_on_death = 1
deathmessage = "vanishes into thin air! It was a fake!"
/mob/living/simple_animal/hostile/illusion/Life(seconds_per_tick = SSMOBS_DT, times_fired)
..()
if(world.time > life_span)
death()
/mob/living/simple_animal/hostile/illusion/proc/Copy_Parent(mob/living/original, life = 50, hp = 100, damage = 0, replicate = 0 )
appearance = original.appearance
parent_mob = original
setDir(original.dir)
life_span = world.time+life
health = hp
melee_damage_lower = damage
melee_damage_upper = damage
multiply_chance = replicate
faction -= "neutral"
transform = initial(transform)
pixel_y = initial(pixel_y)
pixel_x = initial(pixel_x)
/mob/living/simple_animal/hostile/illusion/examine(mob/user)
if(parent_mob)
return parent_mob.examine(user)
else
return ..()
/mob/living/simple_animal/hostile/illusion/AttackingTarget()
. = ..()
if(. && isliving(target) && prob(multiply_chance))
var/mob/living/L = target
if(L.stat == DEAD)
return
var/mob/living/simple_animal/hostile/illusion/M = new(loc)
M.faction = faction.Copy()
M.Copy_Parent(parent_mob, 80, health/2, melee_damage_upper, multiply_chance/2)
M.GiveTarget(L)
///////Actual Types/////////
/mob/living/simple_animal/hostile/illusion/escape
retreat_distance = 10
minimum_distance = 10
melee_damage_lower = 0
melee_damage_upper = 0
speed = -1
obj_damage = 0
environment_smash = ENVIRONMENT_SMASH_NONE
/mob/living/simple_animal/hostile/illusion/escape/AttackingTarget()
return FALSE