-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy pathkrav_maga.dm
246 lines (222 loc) · 9.27 KB
/
krav_maga.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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
/datum/martial_art/krav_maga
name = "Krav Maga"
id = MARTIALART_KRAVMAGA
var/datum/action/neck_chop/neckchop = new/datum/action/neck_chop()
var/datum/action/leg_sweep/legsweep = new/datum/action/leg_sweep()
var/datum/action/lung_punch/lungpunch = new/datum/action/lung_punch()
/datum/action/neck_chop
name = "Neck Chop - Injures the neck, stopping the victim from speaking for a while."
button_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "neckchop"
/datum/action/neck_chop/Trigger()
if(owner.incapacitated())
to_chat(owner, span_warning("You can't use [name] while you're incapacitated."))
return
var/mob/living/carbon/human/H = owner
if (H.mind.martial_art.streak == "neck_chop")
owner.visible_message(span_danger("[owner] assumes a neutral stance."), "<b><i>Your next attack is cleared.</i></b>")
H.mind.martial_art.streak = ""
else
owner.visible_message(span_danger("[owner] assumes the Neck Chop stance!"), "<b><i>Your next attack will be a Neck Chop.</i></b>")
H.mind.martial_art.streak = "neck_chop"
/datum/action/leg_sweep
name = "Leg Sweep - Trips the victim, knocking them down for a brief moment."
button_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "legsweep"
/datum/action/leg_sweep/Trigger()
if(owner.incapacitated())
to_chat(owner, span_warning("You can't use [name] while you're incapacitated."))
return
var/mob/living/carbon/human/H = owner
if (H.mind.martial_art.streak == "leg_sweep")
owner.visible_message(span_danger("[owner] assumes a neutral stance."), "<b><i>Your next attack is cleared.</i></b>")
H.mind.martial_art.streak = ""
else
owner.visible_message(span_danger("[owner] assumes the Leg Sweep stance!"), "<b><i>Your next attack will be a Leg Sweep.</i></b>")
H.mind.martial_art.streak = "leg_sweep"
/datum/action/lung_punch//referred to internally as 'quick choke'
name = "Lung Punch - Delivers a strong punch just above the victim's abdomen, constraining the lungs. The victim will be unable to breathe for a short time."
button_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "lungpunch"
/datum/action/lung_punch/Trigger()
if(owner.incapacitated())
to_chat(owner, span_warning("You can't use [name] while you're incapacitated."))
return
var/mob/living/carbon/human/H = owner
if (H.mind.martial_art.streak == "quick_choke")
owner.visible_message(span_danger("[owner] assumes a neutral stance."), "<b><i>Your next attack is cleared.</i></b>")
H.mind.martial_art.streak = ""
else
owner.visible_message(span_danger("[owner] assumes the Lung Punch stance!"), "<b><i>Your next attack will be a Lung Punch.</i></b>")
H.mind.martial_art.streak = "quick_choke"//internal name for lung punch
/datum/martial_art/krav_maga/teach(mob/living/carbon/human/H,make_temporary=0)
if(..())
to_chat(H, "<span class = 'userdanger'>You know the arts of [name]!</span>")
to_chat(H, "<span class = 'danger'>Place your cursor over a move at the top of the screen to see what it does.</span>")
neckchop.Grant(H)
legsweep.Grant(H)
lungpunch.Grant(H)
/datum/martial_art/krav_maga/on_remove(mob/living/carbon/human/H)
to_chat(H, "<span class = 'userdanger'>You suddenly forget the arts of [name]...</span>")
neckchop.Remove(H)
legsweep.Remove(H)
lungpunch.Remove(H)
/datum/martial_art/krav_maga/proc/check_streak(mob/living/carbon/human/A, mob/living/carbon/human/D)
switch(streak)
if("neck_chop")
streak = ""
neck_chop(A,D)
return 1
if("leg_sweep")
streak = ""
leg_sweep(A,D)
return 1
if("quick_choke")//is actually lung punch
streak = ""
quick_choke(A,D)
return 1
return 0
/datum/martial_art/krav_maga/proc/leg_sweep(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(D.stat || D.IsParalyzed())
return 0
D.visible_message(span_warning("[A] leg sweeps [D]!"), \
span_userdanger("[A] leg sweeps you!"))
playsound(get_turf(A), 'sound/effects/hit_kick.ogg', 50, 1, -1)
D.apply_damage(A.get_punchdamagehigh() / 2, BRUTE) //5 damage
D.Paralyze(40)
log_combat(A, D, "leg sweeped")
return 1
/datum/martial_art/krav_maga/proc/quick_choke(mob/living/carbon/human/A, mob/living/carbon/human/D)//is actually lung punch
D.visible_message(span_warning("[A] pounds [D] on the chest!"), \
span_userdanger("[A] slams your chest! You can't breathe!"))
playsound(get_turf(A), 'sound/effects/hit_punch.ogg', 50, 1, -1)
if(D.losebreath <= 10)
D.losebreath = clamp(D.losebreath + 3, 0, 6)
D.adjustOxyLoss(10)
log_combat(A, D, "quickchoked")
return 1
/datum/martial_art/krav_maga/proc/neck_chop(mob/living/carbon/human/A, mob/living/carbon/human/D)
D.visible_message(span_warning("[A] karate chops [D]'s neck!"), \
span_userdanger("[A] karate chops your neck, rendering you unable to speak!"))
playsound(get_turf(A), 'sound/effects/hit_punch.ogg', 50, 1, -1)
D.apply_damage(A.get_punchdamagehigh() / 2, A.dna.species.attack_type) //5 damage
if(D.silent <= 10)
D.silent = clamp(D.silent + 10, 0, 10)
log_combat(A, D, "neck chopped")
return 1
/datum/martial_art/krav_maga/harm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(check_streak(A,D))
return 1
log_combat(A, D, "punched")
var/picked_hit_type = pick("punches", "kicks")
var/bonus_damage = A.get_punchdamagehigh() //10 damage
if(!(D.mobility_flags & MOBILITY_STAND))
bonus_damage += 5
picked_hit_type = "stomps on"
D.apply_damage(bonus_damage, A.dna.species.attack_type)
if(picked_hit_type == "kicks" || picked_hit_type == "stomps on")
A.do_attack_animation(D, ATTACK_EFFECT_KICK)
playsound(get_turf(D), 'sound/effects/hit_kick.ogg', 50, 1, -1)
else
A.do_attack_animation(D, ATTACK_EFFECT_PUNCH)
playsound(get_turf(D), 'sound/effects/hit_punch.ogg', 50, 1, -1)
D.visible_message(span_danger("[A] [picked_hit_type] [D]!"), \
span_userdanger("[A] [picked_hit_type] you!"))
log_combat(A, D, "[picked_hit_type] with [name]")
return 1
/datum/martial_art/krav_maga/disarm_act(mob/living/carbon/human/A, mob/living/carbon/human/D)
if(check_streak(A,D))
return 1
var/obj/item/I = null
if(prob(60))
I = D.get_active_held_item()
if(I)
if(D.temporarilyRemoveItemFromInventory(I))
A.put_in_hands(I)
D.visible_message(span_danger("[A] has disarmed [D]!"), \
span_userdanger("[A] has disarmed [D]!"))
playsound(D, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
else
D.visible_message(span_danger("[A] attempted to disarm [D]!"), \
span_userdanger("[A] attempted to disarm [D]!"))
playsound(D, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
log_combat(A, D, "disarmed (Krav Maga)", "[I ? " removing \the [I]" : ""]")
return FALSE
//Krav Maga Gloves
/obj/item/clothing/gloves/krav_maga
var/datum/martial_art/krav_maga/style = new
cryo_preserve = TRUE
/obj/item/clothing/gloves/krav_maga/equipped(mob/user, slot)
. = ..()
if(!ishuman(user))
return
if(slot == ITEM_SLOT_GLOVES)
var/mob/living/carbon/human/H = user
style.teach(H,1)
/obj/item/clothing/gloves/krav_maga/dropped(mob/user)
. = ..()
if(!ishuman(user))
return
var/mob/living/carbon/human/H = user
if(H.get_item_by_slot(ITEM_SLOT_GLOVES) == src)
style.remove(H)
/obj/item/clothing/gloves/sec_maga //more obviously named, given to sec
name = "krav maga gloves"
desc = "These gloves can teach you to perform Krav Maga using nanochips, but due to budget cuts, they only work in security areas."
icon_state = "fightgloves"
item_state = "fightgloves"
cold_protection = HANDS
min_cold_protection_temperature = GLOVES_MIN_TEMP_PROTECT
heat_protection = HANDS
max_heat_protection_temperature = GLOVES_MAX_TEMP_PROTECT
resistance_flags = NONE
var/datum/martial_art/krav_maga/style = new
cryo_preserve = TRUE
var/equipper = null //who's wearing the gloves?
var/equipped = FALSE //does the user currently have the martial art?
///List of places that Kravs can be used.
var/list/enabled_areas = list(
/area/security,
/area/ai_monitored/security,
/area/mine/laborcamp,
/area/shuttle/labor,
/area/crew_quarters/heads/hos,
/area/holodeck/rec_center/perma,
)
/obj/item/clothing/gloves/sec_maga/equipped(mob/user, slot)
. = ..()
if(slot == ITEM_SLOT_GLOVES)
equipper = user
START_PROCESSING(SSobj, src)
/obj/item/clothing/gloves/sec_maga/dropped(mob/user, slot)
. = ..()
var/mob/living/carbon/human/H = user
if(H.get_item_by_slot(ITEM_SLOT_GLOVES) == src)
STOP_PROCESSING(SSobj, src)
style.remove(H)
equipper = null
equipped = FALSE
/obj/item/clothing/gloves/sec_maga/proc/check_location()
for(var/location in enabled_areas)
if(istype(get_area(equipper), location))
return TRUE
return FALSE
/obj/item/clothing/gloves/sec_maga/process()
if(!isnull(equipper) && !equipped && check_location())
style.teach(equipper,1)
equipped = TRUE
else if(equipped && !check_location())
style.remove(equipper)
equipped = FALSE
/obj/item/clothing/gloves/krav_maga/combatglovesplus
name = "combat gloves plus"
desc = "These tactical gloves are fireproof and shock resistant, and using nanochip technology it teaches you the powers of krav maga."
icon_state = "combat"
item_state = "blackglovesplus"
strip_delay = 80
cold_protection = HANDS
min_cold_protection_temperature = GLOVES_MIN_TEMP_PROTECT
heat_protection = HANDS
max_heat_protection_temperature = GLOVES_MAX_TEMP_PROTECT
resistance_flags = NONE
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 60, RAD = 0, FIRE = 80, ACID = 50, ELECTRIC = 100)