mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-21 03:55:05 +01:00
Pretty much all new click code
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
// ========================
|
||||
/datum/medical_effect/var/name = "None"
|
||||
/datum/medical_effect/var/strength = 0
|
||||
/datum/medical_effect/var/start = 0
|
||||
/datum/medical_effect/proc/manifest(mob/living/carbon/human/H)
|
||||
/datum/medical_effect/proc/on_life(mob/living/carbon/human/H, strength)
|
||||
/datum/medical_effect/proc/cure(mob/living/carbon/human/H)
|
||||
|
||||
@@ -11,9 +13,11 @@
|
||||
/mob/living/carbon/human/var/list/datum/medical_effect/side_effects = list()
|
||||
/mob/proc/add_side_effect(name, strength = 0)
|
||||
/mob/living/carbon/human/add_side_effect(name, strength = 0)
|
||||
for(var/datum/medical_effect/M in src.side_effects) if(M.name == name)
|
||||
M.strength = max(M.strength, 10)
|
||||
return
|
||||
for(var/datum/medical_effect/M in src.side_effects)
|
||||
if(M.name == name)
|
||||
M.strength = max(M.strength, 10)
|
||||
M.start = life_tick
|
||||
return
|
||||
|
||||
var/list/L = typesof(/datum/medical_effect)-/datum/medical_effect
|
||||
|
||||
@@ -21,32 +25,33 @@
|
||||
var/datum/medical_effect/M = new T
|
||||
if(M.name == name)
|
||||
M.strength = strength
|
||||
M.start = life_tick
|
||||
side_effects += M
|
||||
|
||||
/mob/living/carbon/human/proc/handle_medical_side_effects()
|
||||
if(src.reagents.has_reagent("cryoxadone") || src.reagents.get_reagent_amount("bicaridine") >= 15 || src.reagents.get_reagent_amount("tricordrazine") >= 15)
|
||||
src.add_side_effect("Headache")
|
||||
|
||||
if(src.reagents.get_reagent_amount("kelotane") >= 30 || src.reagents.get_reagent_amount("dermaline") >= 15)
|
||||
src.add_side_effect("Bad Stomach")
|
||||
|
||||
if(src.reagents.get_reagent_amount("tramadol") >= 16 || src.reagents.get_reagent_amount("anti_toxin") >= 30)
|
||||
src.add_side_effect("Cramps")
|
||||
|
||||
if(src.reagents.get_reagent_amount("space_drugs") >= 10)
|
||||
src.add_side_effect("Itch")
|
||||
var/list/L = typesof(/datum/medical_effect)-/datum/medical_effect
|
||||
for(var/T in L)
|
||||
var/datum/medical_effect/M = new T
|
||||
if (M.manifest(src))
|
||||
src.add_side_effect(M.name)
|
||||
|
||||
// One full cycle(in terms of strength) every 10 minutes
|
||||
var/strength_percent = sin(life_tick / 2)
|
||||
for (var/datum/medical_effect/M in side_effects)
|
||||
if (!M) continue
|
||||
var/strength_percent = sin((life_tick - M.start) / 2)
|
||||
log_debug ("[src], tick [life_tick] : Processing [M], Current phase: [strength_percent]")
|
||||
|
||||
// Only do anything if the effect is currently strong enough
|
||||
if(strength_percent >= 0.4)
|
||||
for (var/datum/medical_effect/M in side_effects)
|
||||
if (M.cure(src) || M.strength > 60)
|
||||
// Only do anything if the effect is currently strong enough
|
||||
if(strength_percent >= 0.4)
|
||||
log_debug ("[src], tick [life_tick] : Active phase ; strength [M.strength]")
|
||||
if (M.cure(src) || M.strength > 50)
|
||||
log_debug ("[src], tick [life_tick] : [M] cured or reached end of lifecycle")
|
||||
side_effects -= M
|
||||
del(M)
|
||||
else
|
||||
if(life_tick % 45 == 0)
|
||||
log_debug ("[src], tick [life_tick] : Activating [M] ")
|
||||
M.on_life(src, strength_percent*M.strength)
|
||||
// Effect slowly growing stronger
|
||||
M.strength+=0.08
|
||||
@@ -54,20 +59,22 @@
|
||||
// HEADACHE
|
||||
// ========
|
||||
/datum/medical_effect/headache/name = "Headache"
|
||||
/datum/medical_effect/headache/manifest(mob/living/carbon/human/H)
|
||||
if(H.reagents.has_reagent("alkysine") || H.reagents.has_reagent("tramadol"))
|
||||
return 0
|
||||
if(H.reagents.has_reagent("cryoxadone") >= 10 || H.reagents.get_reagent_amount("bicaridine") >= 15 || H.reagents.get_reagent_amount("tricordrazine") >= 15)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/datum/medical_effect/headache/on_life(mob/living/carbon/human/H, strength)
|
||||
switch(strength)
|
||||
if(1 to 10)
|
||||
H.custom_pain("You feel a light pain in your head.",0)
|
||||
if(11 to 30)
|
||||
H.custom_pain("You feel a throbbing pain in your head!",1)
|
||||
if(31 to 50)
|
||||
if(31 to INFINITY)
|
||||
H.custom_pain("You feel an excrutiating pain in your head!",1)
|
||||
H.adjustBrainLoss(1)
|
||||
if(51 to INFINITY)
|
||||
H.custom_pain("It feels like your head is about to split open!",1)
|
||||
H.adjustBrainLoss(3)
|
||||
var/datum/organ/external/O = H.organs_by_name["head"]
|
||||
O.take_damage(0, 1, 0, "Headache")
|
||||
|
||||
/datum/medical_effect/headache/cure(mob/living/carbon/human/H)
|
||||
if(H.reagents.has_reagent("alkysine") || H.reagents.has_reagent("tramadol"))
|
||||
@@ -78,18 +85,23 @@
|
||||
// BAD STOMACH
|
||||
// ===========
|
||||
/datum/medical_effect/bad_stomach/name = "Bad Stomach"
|
||||
/datum/medical_effect/bad_stomach/manifest(mob/living/carbon/human/H)
|
||||
if(H.reagents.has_reagent("anti_toxin"))
|
||||
return 0
|
||||
if(H.reagents.get_reagent_amount("kelotane") >= 30 || H.reagents.get_reagent_amount("dermaline") >= 15)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
/datum/medical_effect/bad_stomach/on_life(mob/living/carbon/human/H, strength)
|
||||
switch(strength)
|
||||
if(1 to 10)
|
||||
H.custom_pain("You feel a bit light around the stomach.",0)
|
||||
if(11 to 30)
|
||||
H.custom_pain("Your stomach hurts.",0)
|
||||
if(31 to 50)
|
||||
if(31 to INFINITY)
|
||||
H.custom_pain("You feel sick.",1)
|
||||
H.adjustToxLoss(1)
|
||||
if(51 to INFINITY)
|
||||
H.custom_pain("You can't hold it in any longer!",1)
|
||||
H.vomit()
|
||||
|
||||
/datum/medical_effect/bad_stomach/cure(mob/living/carbon/human/H)
|
||||
if(H.reagents.has_reagent("anti_toxin"))
|
||||
@@ -101,20 +113,22 @@
|
||||
// CRAMPS
|
||||
// ======
|
||||
/datum/medical_effect/cramps/name = "Cramps"
|
||||
/datum/medical_effect/cramps/manifest(mob/living/carbon/human/H)
|
||||
if(H.reagents.has_reagent("inaprovaline"))
|
||||
return 0
|
||||
if( H.reagents.get_reagent_amount("anti_toxin") >= 30 || H.reagents.get_reagent_amount("tramadol") >= 15)
|
||||
return 1
|
||||
return 0
|
||||
/datum/medical_effect/cramps/on_life(mob/living/carbon/human/H, strength)
|
||||
switch(strength)
|
||||
if(1 to 10)
|
||||
H.custom_pain("The muscles in your body hurt a little.",0)
|
||||
if(11 to 30)
|
||||
H.custom_pain("The muscles in your body cramp up painfully.",0)
|
||||
if(31 to 50)
|
||||
if(31 to INFINITY)
|
||||
H.emote("me",1,"flinches as all the muscles in their body cramp up.")
|
||||
H.custom_pain("There's pain all over your body.",1)
|
||||
H.adjustToxLoss(1)
|
||||
if(51 to INFINITY)
|
||||
H.emote("me",1,"flinches as all the muscles in their body cramp up.")
|
||||
H.custom_pain("It feels as though your muscles are being ripped apart!",1)
|
||||
H.apply_damage(1, used_weapon = "Cramps")
|
||||
|
||||
/datum/medical_effect/cramps/cure(mob/living/carbon/human/H)
|
||||
if(H.reagents.has_reagent("inaprovaline"))
|
||||
@@ -125,21 +139,22 @@
|
||||
// ITCH
|
||||
// ====
|
||||
/datum/medical_effect/itch/name = "Itch"
|
||||
/datum/medical_effect/itch/manifest(mob/living/carbon/human/H)
|
||||
if(H.reagents.has_reagent("inaprovaline"))
|
||||
return 0
|
||||
if(H.reagents.get_reagent_amount("space_drugs") >= 10)
|
||||
return 1
|
||||
return 0
|
||||
/datum/medical_effect/itch/on_life(mob/living/carbon/human/H, strength)
|
||||
switch(strength)
|
||||
if(1 to 10)
|
||||
H.custom_pain("You feel a slight itch.",0)
|
||||
if(11 to 30)
|
||||
H.custom_pain("You want to scratch your itch badly.",0)
|
||||
if(31 to 50)
|
||||
if(31 to INFINITY)
|
||||
H.emote("me",1,"shivers slightly.")
|
||||
H.custom_pain("This itch makes it really hard to concentrate.",1)
|
||||
H.adjustToxLoss(1)
|
||||
if(51 to INFINITY)
|
||||
H.emote("me",1,"shivers.")
|
||||
H.custom_pain("The itch starts hurting and oozing blood.",1)
|
||||
H.apply_damage(1, BURN, used_weapon = "Itch")
|
||||
H.drip(1)
|
||||
|
||||
/datum/medical_effect/itch/cure(mob/living/carbon/human/H)
|
||||
if(H.reagents.has_reagent("inaprovaline"))
|
||||
|
||||
@@ -9,27 +9,27 @@ proc/assign_sec_to_department(var/mob/living/carbon/human/H)
|
||||
switch(department)
|
||||
if("supply")
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/security/cargo(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec/department/supply(H), slot_ears)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec/department/supply(H), slot_l_ear)
|
||||
access = list(access_mailsorting, access_mining)
|
||||
destination = /area/security/checkpoint/supply
|
||||
if("engineering")
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/security/engine(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec/department/engi(H), slot_ears)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec/department/engi(H), slot_l_ear)
|
||||
access = list(access_construction, access_engine)
|
||||
destination = /area/security/checkpoint/engineering
|
||||
if("medical")
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/security/med(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec/department/med(H), slot_ears)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec/department/med(H), slot_l_ear)
|
||||
access = list(access_medical)
|
||||
destination = /area/security/checkpoint/medical
|
||||
if("science")
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/security/science(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec/department/sci(H), slot_ears)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec/department/sci(H), slot_l_ear)
|
||||
access = list(access_research)
|
||||
destination = /area/security/checkpoint/science
|
||||
else
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/security(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec(H), slot_ears)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec(H), slot_l_ear)
|
||||
|
||||
|
||||
if(destination)
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_sec(H), slot_back)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/hos(H), slot_ears)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/hos(H), slot_l_ear)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/administrator(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/boots(H), slot_shoes)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/pda/heads/hos(H), slot_belt)
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec(H), slot_ears)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec(H), slot_l_ear)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_sec(H), slot_back)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/advisor(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/boots(H), slot_shoes)
|
||||
@@ -72,7 +72,7 @@
|
||||
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec(H), slot_ears)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec(H), slot_l_ear)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/det(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(H), slot_shoes)
|
||||
@@ -109,7 +109,7 @@
|
||||
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec(H), slot_ears)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/headset_sec(H), slot_l_ear)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_sec(H), slot_back)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/rank/supervisor(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/boots(H), slot_shoes)
|
||||
@@ -138,7 +138,7 @@
|
||||
|
||||
equip(var/mob/living/carbon/human/H)
|
||||
if(!H) return 0
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/hop(H), slot_ears)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/hop(H), slot_l_ear)
|
||||
if(H.backbag == 2) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(H), slot_back)
|
||||
if(H.backbag == 3) H.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel_norm(H), slot_back)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
dir = NORTHWEST
|
||||
if(NORTHWEST)
|
||||
dir = NORTH
|
||||
return
|
||||
return 1
|
||||
|
||||
/obj/effect/bmode/buildhelp
|
||||
icon = 'icons/misc/buildmode.dmi'
|
||||
@@ -95,7 +95,7 @@
|
||||
usr << "\blue Left Mouse Button on turf/obj/mob = Select"
|
||||
usr << "\blue Right Mouse Button on turf/obj/mob = Throw"
|
||||
usr << "\blue ***********************************************************"
|
||||
return
|
||||
return 1
|
||||
|
||||
/obj/effect/bmode/buildquit
|
||||
icon_state = "buildquit"
|
||||
@@ -103,6 +103,7 @@
|
||||
|
||||
Click()
|
||||
togglebuildmode(master.cl.mob)
|
||||
return 1
|
||||
|
||||
/obj/effect/bmode/buildholder
|
||||
density = 0
|
||||
@@ -142,7 +143,7 @@
|
||||
else if(pa.Find("right"))
|
||||
switch(master.cl.buildmode)
|
||||
if(1)
|
||||
return
|
||||
return 1
|
||||
if(2)
|
||||
objholder = input(usr,"Enter typepath:" ,"Typepath","/obj/structure/closet")
|
||||
var/list/removed_paths = list("/obj/effect/bhole")
|
||||
@@ -156,9 +157,9 @@
|
||||
|
||||
master.buildmode.varholder = input(usr,"Enter variable name:" ,"Name", "name")
|
||||
if(master.buildmode.varholder in locked && !check_rights(R_DEBUG,0))
|
||||
return
|
||||
return 1
|
||||
var/thetype = input(usr,"Select variable type:" ,"Type") in list("text","number","mob-reference","obj-reference","turf-reference")
|
||||
if(!thetype) return
|
||||
if(!thetype) return 1
|
||||
switch(thetype)
|
||||
if("text")
|
||||
master.buildmode.valueholder = input(usr,"Enter variable value:" ,"Value", "value") as text
|
||||
@@ -170,9 +171,9 @@
|
||||
master.buildmode.valueholder = input(usr,"Enter variable value:" ,"Value") as obj in world
|
||||
if("turf-reference")
|
||||
master.buildmode.valueholder = input(usr,"Enter variable value:" ,"Value") as turf in world
|
||||
return 1
|
||||
|
||||
|
||||
/proc/build_click(var/mob/user, buildmode, location, control, params, var/obj/object)
|
||||
/proc/build_click(var/mob/user, buildmode, params, var/obj/object)
|
||||
var/obj/effect/bmode/buildholder/holder = null
|
||||
for(var/obj/effect/bmode/buildholder/H)
|
||||
if(H.cl == user.client)
|
||||
|
||||
@@ -212,7 +212,7 @@ var/global/admin_emergency_team = 0 // Used for admin-spawned response teams
|
||||
/mob/living/carbon/human/proc/equip_response_team(leader_selected = 0)
|
||||
|
||||
// Headset
|
||||
equip_to_slot_or_del(new /obj/item/device/radio/headset/ert(src), slot_ears)
|
||||
equip_to_slot_or_del(new /obj/item/device/radio/headset/ert(src), slot_l_ear)
|
||||
|
||||
// Uniform
|
||||
equip_to_slot_or_del(new /obj/item/clothing/under/rank/centcom_officer(src), slot_w_uniform)
|
||||
|
||||
Reference in New Issue
Block a user