-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy pathatmos_grenades.dm
130 lines (114 loc) · 4.92 KB
/
atmos_grenades.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
/obj/item/grenade/gas_crystal
desc = "Some kind of crystal, this shouldn't spawn"
name = "Gas Crystal"
icon = 'icons/obj/grenade.dmi'
icon_state = "bluefrag"
item_state = "flashbang"
resistance_flags = FIRE_PROOF
/obj/item/grenade/gas_crystal/preprime(mob/user, delayoverride, msg = TRUE, volume = 60)
var/turf/turf_loc = get_turf(src)
log_grenade(user, turf_loc) //Inbuilt admin procs already handle null users
if(user)
add_fingerprint(user)
if(msg)
to_chat(user, span_warning("You crush the [src]! [capitalize(DisplayTimeText(det_time))]!"))
active = TRUE
icon_state = initial(icon_state) + "_active"
playsound(src, 'sound/effects/hit_on_shattered_glass.ogg', volume, TRUE)
addtimer(CALLBACK(src, PROC_REF(prime)), isnull(delayoverride)? det_time : delayoverride)
/obj/item/grenade/gas_crystal/healium_crystal
name = "Healium crystal"
desc = "A crystal made from the Healium gas, it's cold to the touch."
icon_state = "healium_crystal"
grind_results = list(/datum/reagent/gas/healium = 20)
///Amount of stamina damage mobs will take if in range
var/stamina_damage = 30
///Range of the grenade that will cool down and affect mobs
var/freeze_range = 4
///Amount of gas released if the state is optimal
var/gas_amount = 200
/obj/item/grenade/gas_crystal/healium_crystal/prime(mob/living/lanced_by)
. = ..()
update_mob()
playsound(src, 'sound/effects/spray2.ogg', 100, TRUE)
for(var/turf/turf_loc in view(freeze_range, loc))
if(!isopenturf(turf_loc))
continue
var/distance_from_center = max(get_dist(turf_loc, loc), 1)
var/turf/open/floor_loc = turf_loc
if(floor_loc.air.return_temperature() > 260 && floor_loc.air.return_temperature() < 370)
floor_loc.atmos_spawn_air("n2=[(gas_amount - 150) / distance_from_center];TEMP=273")
if(floor_loc.air.return_temperature() > 370)
floor_loc.atmos_spawn_air("n2=[gas_amount / distance_from_center];TEMP=30")
floor_loc.MakeSlippery(TURF_WET_PERMAFROST, (5 / distance_from_center) MINUTES)
if(floor_loc.air.get_gases(GAS_PLASMA))
floor_loc.air.adjust_moles(GAS_PLASMA, -(floor_loc.air.get_moles(GAS_PLASMA) * 0.5 / distance_from_center))
for(var/mob/living/carbon/live_mob in turf_loc)
live_mob.adjustStaminaLoss(stamina_damage / distance_from_center)
live_mob.adjust_bodytemperature(-150 / distance_from_center)
if(live_mob.stat > CONSCIOUS || live_mob.health <= 20)
var/datum/reagent/gas/healium/heal_reagent = new()
heal_reagent.reaction_mob(live_mob, VAPOR, 10, permeability = live_mob.get_permeability())
qdel(heal_reagent)
qdel(src)
/obj/item/grenade/gas_crystal/pluonium_crystal
name = "Pluonium crystal"
desc = "A crystal made from pluonium, you can see the liquid nitrogen and oxygen inside."
icon_state = "pluonium_crystal"
///Range of the grenade air refilling
var/refill_range = 5
///Amount of Nitrogen gas released (close to the grenade)
var/n2_gas_amount = 80
///Amount of Oxygen gas released (close to the grenade)
var/o2_gas_amount = 30
/obj/item/grenade/gas_crystal/pluonium_crystal/prime()
. = ..()
update_mob()
playsound(src, 'sound/effects/spray2.ogg', 100, TRUE)
for(var/turf/turf_loc in view(refill_range, loc))
if(!isopenturf(turf_loc))
continue
var/distance_from_center = max(get_dist(turf_loc, loc), 1)
var/turf/open/floor_loc = turf_loc
floor_loc.atmos_spawn_air("n2=[n2_gas_amount / distance_from_center];o2=[o2_gas_amount / distance_from_center];TEMP=273")
qdel(src)
/obj/item/grenade/gas_crystal/nitrous_oxide_crystal
name = "N2O crystal"
desc = "A crystal made from the N2O gas, you can see the liquid gases inside."
icon_state = "n2o_crystal"
///Range of the grenade air refilling
var/fill_range = 1
///Amount of n2o gas released (close to the grenade)
var/n2o_gas_amount = 10
/obj/item/grenade/gas_crystal/nitrous_oxide_crystal/prime()
. = ..()
update_mob()
playsound(src, 'sound/effects/spray2.ogg', 100, TRUE)
for(var/turf/turf_loc in view(fill_range, loc))
if(!isopenturf(turf_loc))
continue
var/distance_from_center = max(get_dist(turf_loc, loc), 1)
var/turf/open/floor_loc = turf_loc
floor_loc.atmos_spawn_air("n2o=[n2o_gas_amount / distance_from_center];TEMP=273")
qdel(src)
/obj/item/grenade/gas_crystal/crystal_foam
name = "crystal foam"
desc = "A crystal with a foggy inside"
icon_state = "crystal_foam"
var/breach_range = 7
/obj/item/grenade/gas_crystal/crystal_foam/prime(mob/living/lanced_by)
. = ..()
var/datum/reagents/first_batch = new
var/datum/reagents/second_batch = new
var/list/datum/reagents/reactants = list()
first_batch.add_reagent(/datum/reagent/aluminium, 75)
second_batch.add_reagent(/datum/reagent/smart_foaming_agent, 25)
second_batch.add_reagent(/datum/reagent/toxin/acid/fluacid, 25)
reactants += first_batch
reactants += second_batch
var/turf/detonation_turf = get_turf(src)
chem_splash(detonation_turf, breach_range, reactants)
playsound(src, 'sound/effects/spray2.ogg', 100, TRUE)
log_game("A grenade detonated at [AREACOORD(detonation_turf)]")
update_mob()
qdel(src)