This repository has been archived by the owner on Sep 12, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 66
/
silicon_defense.dm
138 lines (125 loc) · 5.15 KB
/
silicon_defense.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/mob/living/silicon/grippedby(mob/living/user, instant = FALSE)
return //can't upgrade a simple pull into a more aggressive grab.
/mob/living/silicon/get_ear_protection()//no ears
return 2
/mob/living/silicon/attack_alien(mob/living/carbon/alien/humanoid/M)
if(..()) //if harm or disarm intent
var/damage = 20
if (prob(90))
log_combat(M, src, "attacked")
playsound(loc, 'sound/weapons/slash.ogg', 25, TRUE, -1)
visible_message("<span class='danger'>[M] slashes at [src]!</span>", \
"<span class='userdanger'>[M] slashes at you!</span>", null, null, M)
to_chat(M, "<span class='danger'>You slash at [src]!</span>")
if(prob(8))
flash_act(affect_silicon = 1)
log_combat(M, src, "attacked")
adjustBruteLoss(damage)
updatehealth()
else
playsound(loc, 'sound/weapons/slashmiss.ogg', 25, TRUE, -1)
visible_message("<span class='danger'>[M]'s swipe misses [src]!</span>", \
"<span class='danger'>You avoid [M]'s swipe!</span>", null, null, M)
to_chat(M, "<span class='warning'>Your swipe misses [src]!</span>")
/mob/living/silicon/attack_animal(mob/living/simple_animal/M)
. = ..()
if(.)
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
if(prob(damage))
for(var/mob/living/N in buckled_mobs)
N.Paralyze(20)
unbuckle_mob(N)
N.visible_message("<span class='danger'>[N] is knocked off of [src] by [M]!</span>", \
"<span class='userdanger'>You're knocked off of [src] by [M]!</span>", null, null, M)
to_chat(M, "<span class='danger'>You knock [N] off of [src]!</span>")
switch(M.melee_damage_type)
if(BRUTE)
adjustBruteLoss(damage)
if(BURN)
adjustFireLoss(damage)
if(TOX)
adjustToxLoss(damage)
if(OXY)
adjustOxyLoss(damage)
if(CLONE)
adjustCloneLoss(damage)
if(STAMINA)
adjustStaminaLoss(damage)
/mob/living/silicon/attack_paw(mob/living/user)
return attack_hand(user)
/mob/living/silicon/attack_larva(mob/living/carbon/alien/larva/L)
if(L.a_intent == INTENT_HELP)
visible_message("<span class='notice'>[L.name] rubs its head against [src].</span>")
/mob/living/silicon/attack_hulk(mob/living/carbon/human/user)
. = ..()
if(!.)
return
adjustBruteLoss(rand(10, 15))
playsound(loc, "punch", 25, TRUE, -1)
visible_message("<span class='danger'>[user] punches [src]!</span>", \
"<span class='userdanger'>[user] punches you!</span>", null, COMBAT_MESSAGE_RANGE, user)
to_chat(user, "<span class='danger'>You punch [src]!</span>")
//ATTACK HAND IGNORING PARENT RETURN VALUE
/mob/living/silicon/attack_hand(mob/living/carbon/human/M)
. = FALSE
if(SEND_SIGNAL(src, COMSIG_ATOM_ATTACK_HAND, M) & COMPONENT_NO_ATTACK_HAND)
. = TRUE
switch(M.a_intent)
if ("help")
visible_message("<span class='notice'>[M] pets [src].</span>", \
"<span class='notice'>[M] pets you.</span>", null, null, M)
to_chat(M, "<span class='notice'>You pet [src].</span>")
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT_RND, "pet_borg", /datum/mood_event/pet_borg)
if("grab")
grabbedby(M)
else
M.do_attack_animation(src, ATTACK_EFFECT_PUNCH)
playsound(src.loc, 'sound/effects/bang.ogg', 10, TRUE)
visible_message("<span class='danger'>[M] punches [src], but doesn't leave a dent!</span>", \
"<span class='warning'>[M] punches you, but doesn't leave a dent!</span>", null, COMBAT_MESSAGE_RANGE, M)
to_chat(M, "<span class='danger'>You punch [src], but don't leave a dent!</span>")
/mob/living/silicon/attack_drone(mob/living/simple_animal/drone/M)
if(M.a_intent == INTENT_HARM)
return
return ..()
/mob/living/silicon/electrocute_act(shock_damage, source, siemens_coeff = 1, flags = NONE)
if(buckled_mobs)
for(var/mob/living/M in buckled_mobs)
unbuckle_mob(M)
M.electrocute_act(shock_damage/100, source, siemens_coeff, flags) //Hard metal shell conducts!
return 0 //So borgs they don't die trying to fix wiring
/mob/living/silicon/emp_act(severity)
. = ..()
to_chat(src, "<span class='danger'>Warning: Electromagnetic pulse detected.</span>")
if(. & EMP_PROTECT_SELF)
return
switch(severity)
if(1)
src.take_bodypart_damage(20)
if(2)
src.take_bodypart_damage(10)
to_chat(src, "<span class='userdanger'>*BZZZT*</span>")
for(var/mob/living/M in buckled_mobs)
if(prob(severity*50))
unbuckle_mob(M)
M.Paralyze(40)
M.visible_message("<span class='boldwarning'>[M] is thrown off of [src]!</span>")
flash_act(affect_silicon = 1)
/mob/living/silicon/bullet_act(obj/projectile/Proj, def_zone)
SEND_SIGNAL(src, COMSIG_ATOM_BULLET_ACT, Proj, def_zone)
if((Proj.damage_type == BRUTE || Proj.damage_type == BURN))
adjustBruteLoss(Proj.damage)
if(prob(Proj.damage*1.5))
for(var/mob/living/M in buckled_mobs)
M.visible_message("<span class='boldwarning'>[M] is knocked off of [src]!</span>")
unbuckle_mob(M)
M.Paralyze(40)
if(Proj.stun || Proj.knockdown || Proj.paralyze)
for(var/mob/living/M in buckled_mobs)
unbuckle_mob(M)
M.visible_message("<span class='boldwarning'>[M] is knocked off of [src] by the [Proj]!</span>")
Proj.on_hit(src)
return BULLET_ACT_HIT
/mob/living/silicon/flash_act(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /obj/screen/fullscreen/flash/static)
if(affect_silicon)
return ..()