diff --git a/code/game/gamemodes/wizard/spellbook.dm b/code/game/gamemodes/wizard/spellbook.dm index 6ea37d3ceee..8bfb0a8112c 100644 --- a/code/game/gamemodes/wizard/spellbook.dm +++ b/code/game/gamemodes/wizard/spellbook.dm @@ -810,10 +810,8 @@ /obj/item/weapon/spellbook/oneuse/forcewall/recoil(mob/user) ..() user <<"You suddenly feel very solid!" - var/obj/structure/closet/statue/S = new /obj/structure/closet/statue(user.loc, user) - S.timer = 30 - user.drop_item() - + user.Stun(2) + user.petrify(30) /obj/item/weapon/spellbook/oneuse/knock spell = /obj/effect/proc_holder/spell/aoe_turf/knock diff --git a/code/game/objects/structures/crates_lockers/closets/statue.dm b/code/game/objects/structures/crates_lockers/closets/statue.dm index 850e07b9e93..18054f64898 100644 --- a/code/game/objects/structures/crates_lockers/closets/statue.dm +++ b/code/game/objects/structures/crates_lockers/closets/statue.dm @@ -1,146 +1,106 @@ -/obj/structure/closet/statue +/obj/structure/statue/petrified name = "statue" desc = "An incredibly lifelike marble carving." - icon = 'icons/obj/statue.dmi' icon_state = "human_male" density = 1 anchored = 1 obj_integrity = 200 max_integrity = 200 - var/intialTox = 0 //these are here to keep the mob from taking damage from things that logically wouldn't affect a rock - var/intialFire = 0 //it's a little sloppy I know but it was this or the GODMODE flag. Lesser of two evils. - var/intialBrute = 0 - var/intialOxy = 0 var/timer = 240 //eventually the person will be freed + var/mob/living/petrified_mob -/obj/structure/closet/statue/New(loc, var/mob/living/L) - - if(ishuman(L) || ismonkey(L) || iscorgi(L)) +/obj/structure/statue/petrified/New(loc, mob/living/L, statue_timer) + if(statue_timer) + timer = statue_timer + if(L) + petrified_mob = L if(L.buckled) L.buckled.unbuckle_mob(L,force=1) - L.reset_perspective(src) - L.loc = src - L.disabilities += MUTE - L.faction += "mimic" //Stops mimics from instaqdeling people in statues L.visible_message("[L]'s skin rapidly turns to marble!", "Your body freezes up! Can't... move... can't... think...") - + L.forceMove(src) + L.disabilities |= MUTE + L.faction += "mimic" //Stops mimics from instaqdeling people in statues + L.status_flags |= GODMODE obj_integrity = L.health + 100 //stoning damaged mobs will result in easier to shatter statues max_integrity = obj_integrity - intialTox = L.getToxLoss() - intialFire = L.getFireLoss() - intialBrute = L.getBruteLoss() - intialOxy = L.getOxyLoss() - if(ishuman(L)) - var/mob/living/carbon/human/H = L - name = "statue of [H.name]" - H.bleedsuppress = 1 - if(H.gender == "female") - icon_state = "human_female" - else if(ismonkey(L)) - name = "statue of a monkey" - icon_state = "monkey" - else if(iscorgi(L)) - name = "statue of a corgi" - icon_state = "corgi" - desc = "If it takes forever, I will wait for you..." - - if(obj_integrity == 0) //meaning if the statue didn't find a valid target - qdel(src) - return - - START_PROCESSING(SSobj, src) + START_PROCESSING(SSobj, src) ..() - icon = L.icon - icon_state = L.icon_state - overlays = L.overlays - color = list(rgb(77,77,77), rgb(150,150,150), rgb(28,28,28), rgb(0,0,0)) -/obj/structure/closet/statue/process() +/obj/structure/statue/petrified/process() + if(!petrified_mob) + STOP_PROCESSING(SSobj, src) timer-- - for(var/mob/living/M in src) //Go-go gadget stasis field - M.setToxLoss(intialTox) - M.adjustFireLoss(intialFire - M.getFireLoss()) - M.adjustBruteLoss(intialBrute - M.getBruteLoss()) - M.setOxyLoss(intialOxy) - M.Stun(1) //So they can't do anything while petrified + petrified_mob.Stun(2) //So they can't do anything while petrified if(timer <= 0) - dump_contents() STOP_PROCESSING(SSobj, src) qdel(src) -/obj/structure/closet/statue/dump_contents() +/obj/structure/statue/petrified/contents_explosion(severity, target) + return + +/obj/structure/statue/petrified/handle_atom_del(atom/A) + if(A == petrified_mob) + petrified_mob = null + +/obj/structure/statue/petrified/Destroy() if(istype(src.loc, /mob/living/simple_animal/hostile/statue)) var/mob/living/simple_animal/hostile/statue/S = src.loc - src.loc = S.loc + forceMove(S.loc) if(S.mind) - for(var/mob/M in contents) - S.mind.transfer_to(M) - M.Weaken(5) - M << "You slowly come back to your senses. You are in control of yourself again!" - break + if(petrified_mob) + S.mind.transfer_to(petrified_mob) + petrified_mob.Weaken(5) + petrified_mob << "You slowly come back to your senses. You are in control of yourself again!" qdel(S) - for(var/obj/O in src) - O.loc = src.loc + O.forceMove(loc) - for(var/mob/living/M in src) - M.forceMove(loc) - M.disabilities -= MUTE - M.take_overall_damage((M.health - obj_integrity + 100)) //any new damage the statue incurred is transfered to the mob - M.faction -= "mimic" - M.reset_perspective(null) + if(petrified_mob) + petrified_mob.status_flags &= ~GODMODE + petrified_mob.forceMove(loc) + petrified_mob.disabilities -= MUTE + petrified_mob.take_overall_damage((petrified_mob.health - obj_integrity + 100)) //any new damage the statue incurred is transfered to the mob + petrified_mob.faction -= "mimic" + petrified_mob = null + return ..() -/obj/structure/closet/statue/take_contents() - return - -/obj/structure/closet/statue/open() - return - -/obj/structure/closet/statue/take_contents() - return - -/obj/structure/closet/statue/open() - return - -/obj/structure/closet/statue/insert() - return - -/obj/structure/closet/statue/close() - return - -/obj/structure/closet/statue/toggle() - return - -/obj/structure/closet/statue/MouseDrop_T() - return - -/obj/structure/closet/statue/relaymove() - return - -/obj/structure/closet/statue/attack_hand() - return - -/obj/structure/closet/statue/verb_toggleopen() - return - -/obj/structure/closet/statue/update_icon() - return - -/obj/structure/closet/statue/deconstruct(disassembled = TRUE) +/obj/structure/statue/petrified/deconstruct(disassembled = TRUE) if(!disassembled) - for(var/mob/living/M in src) - M.dust() - dump_contents() + if(petrified_mob) + petrified_mob.dust() visible_message("[src] shatters!.") qdel(src) -/obj/structure/closet/statue/container_resist() - return -/mob/living/proc/petrify() - if(istype(loc, /obj/structure/closet/statue)) //If they're already petrified +/mob/proc/petrify(statue_timer) + +/mob/living/carbon/human/petrify(statue_timer) + if(!isturf(loc)) return 0 - new /obj/structure/closet/statue(get_turf(src), src) + var/obj/structure/statue/petrified/S = new(loc, src, statue_timer) + S.name = "statue of [name]" + bleedsuppress = 1 + S.icon = icon + S.icon_state = icon_state + S.overlays = overlays + S.color = list(rgb(77,77,77), rgb(150,150,150), rgb(28,28,28), rgb(0,0,0)) + return 1 + +/mob/living/carbon/monkey/petrify(statue_timer) + if(!isturf(loc)) + return 0 + var/obj/structure/statue/petrified/S = new(loc, src, statue_timer) + S.name = "statue of a monkey" + S.icon_state = "monkey" + return 1 + +/mob/living/simple_animal/pet/dog/corgi/petrify(statue_timer) + if(!isturf(loc)) + return 0 + var/obj/structure/statue/petrified/S = new (loc, src, statue_timer) + S.name = "statue of a corgi" + S.icon_state = "corgi" + S.desc = "If it takes forever, I will wait for you..." return 1 diff --git a/code/game/objects/structures/statues.dm b/code/game/objects/structures/statues.dm index fdf0ca8a919..471c557d835 100644 --- a/code/game/objects/structures/statues.dm +++ b/code/game/objects/structures/statues.dm @@ -9,12 +9,9 @@ density = 1 anchored = 0 obj_integrity = 100 + max_integrity = 100 var/oreAmount = 7 - var/mineralType = "metal" - -/obj/structure/statue/Destroy() - density = 0 - return ..() + var/material_drop_type = /obj/item/stack/sheet/metal /obj/structure/statue/attackby(obj/item/weapon/W, mob/living/user, params) add_fingerprint(user) @@ -53,7 +50,7 @@ return user.visible_message("[user] slices apart the [name].", \ "You slice apart the [name].") - deconstruct(FALSE) + deconstruct(TRUE) else if(istype(W, /obj/item/weapon/pickaxe/drill/jackhammer)) var/obj/item/weapon/pickaxe/drill/jackhammer/D = W @@ -74,7 +71,7 @@ playsound(loc, 'sound/items/Welder2.ogg', 50, 1) user.visible_message("[user] slices apart the [name].", \ "You slice apart the [name]!") - deconstruct(FALSE) + deconstruct(TRUE) else return ..() @@ -89,24 +86,12 @@ /obj/structure/statue/deconstruct(disassembled = TRUE) if(!(flags & NODECONSTRUCT)) - if(disassembled) - if (mineralType == "metal") - var/ore = /obj/item/stack/sheet/metal - for(var/i = 1, i <= oreAmount, i++) - new ore(get_turf(src)) - else - var/ore = text2path("/obj/item/stack/sheet/mineral/[mineralType]") - for(var/i = 1, i <= oreAmount, i++) - new ore(get_turf(src)) - else - if (mineralType == "metal") - var/ore = /obj/item/stack/sheet/metal - for(var/i = 3, i <= oreAmount, i++) - new ore(get_turf(src)) - else - var/ore = text2path("/obj/item/stack/sheet/mineral/[mineralType]") - for(var/i = 3, i <= oreAmount, i++) - new ore(get_turf(src)) + if(material_drop_type) + var/drop_amt = oreAmount + if(!disassembled) + drop_amt -= 2 + if(drop_amt > 0) + new material_drop_type(get_turf(src), drop_amt) qdel(src) //////////////////////////////////////STATUES///////////////////////////////////////////////////////////// @@ -115,7 +100,7 @@ /obj/structure/statue/uranium obj_integrity = 300 luminosity = 2 - mineralType = "uranium" + material_drop_type = /obj/item/stack/sheet/mineral/uranium var/last_event = 0 var/active = null @@ -159,7 +144,7 @@ /obj/structure/statue/plasma obj_integrity = 200 - mineralType = "plasma" + material_drop_type = /obj/item/stack/sheet/mineral/plasma desc = "This statue is suitably made from plasma." /obj/structure/statue/plasma/scientist @@ -208,7 +193,7 @@ /obj/structure/statue/gold obj_integrity = 300 - mineralType = "gold" + material_drop_type = /obj/item/stack/sheet/mineral/gold desc = "This is a highly valuable statue made from gold." /obj/structure/statue/gold/hos @@ -235,7 +220,7 @@ /obj/structure/statue/silver obj_integrity = 300 - mineralType = "silver" + material_drop_type = /obj/item/stack/sheet/mineral/silver desc = "This is a valuable statue made from silver." /obj/structure/statue/silver/md @@ -262,7 +247,7 @@ /obj/structure/statue/diamond obj_integrity = 1000 - mineralType = "diamond" + material_drop_type = /obj/item/stack/sheet/mineral/diamond desc = "This is a very expensive diamond statue" /obj/structure/statue/diamond/captain @@ -281,7 +266,7 @@ /obj/structure/statue/bananium obj_integrity = 300 - mineralType = "bananium" + material_drop_type = /obj/item/stack/sheet/mineral/bananium desc = "A bananium statue with a small engraving:'HOOOOOOONK'." var/spam_flag = 0 @@ -316,7 +301,7 @@ /obj/structure/statue/sandstone obj_integrity = 50 - mineralType = "sandstone" + material_drop_type = /obj/item/stack/sheet/mineral/sandstone /obj/structure/statue/sandstone/assistant name = "statue of an assistant" @@ -334,7 +319,7 @@ /obj/structure/statue/snow obj_integrity = 50 - mineralType = "snow" + material_drop_type = /obj/item/stack/sheet/mineral/snow /obj/structure/statue/snow/snowman name = "snowman" diff --git a/code/modules/projectiles/projectile/magic.dm b/code/modules/projectiles/projectile/magic.dm index fe6dd50c645..6ad3963adfb 100644 --- a/code/modules/projectiles/projectile/magic.dm +++ b/code/modules/projectiles/projectile/magic.dm @@ -332,35 +332,36 @@ damage_type = BURN nodamage = 1 -/obj/item/projectile/magic/animate/Bump(atom/change) +/obj/item/projectile/magic/animate/on_hit(atom/target, blocked = 0) ..() - if(istype(change, /obj/item) || istype(change, /obj/structure) && !is_type_in_list(change, protected_objects)) - if(istype(change, /obj/structure/closet/statue)) - for(var/mob/living/carbon/human/H in change.contents) - var/mob/living/simple_animal/hostile/statue/S = new /mob/living/simple_animal/hostile/statue(change.loc, firer) - S.name = "statue of [H.name]" + if((istype(target, /obj/item) || istype(target, /obj/structure)) && !is_type_in_list(target, protected_objects)) + if(istype(target, /obj/structure/statue/petrified)) + var/obj/structure/statue/petrified/P = target + if(P.petrified_mob) + var/mob/living/L = P.petrified_mob + var/mob/living/simple_animal/hostile/statue/S = new (P.loc, firer) + S.name = "statue of [L.name]" S.faction = list("\ref[firer]") - S.icon = change.icon - S.icon_state = change.icon_state - S.overlays = change.overlays - S.color = change.color - if(H.mind) - H.mind.transfer_to(S) + S.icon = P.icon + S.icon_state = P.icon_state + S.overlays = P.overlays + S.color = P.color + if(L.mind) + L.mind.transfer_to(S) S << "You are an animate statue. You cannot move when monitored, but are nearly invincible and deadly when unobserved! Do not harm [firer.name], your creator." - H = change - H.loc = S + P.loc = S qdel(src) return else - var/obj/O = change + var/obj/O = target if(istype(O, /obj/item/weapon/gun)) new /mob/living/simple_animal/hostile/mimic/copy/ranged(O.loc, O, firer) else new /mob/living/simple_animal/hostile/mimic/copy(O.loc, O, firer) - else if(istype(change, /mob/living/simple_animal/hostile/mimic/copy)) + else if(istype(target, /mob/living/simple_animal/hostile/mimic/copy)) // Change our allegiance! - var/mob/living/simple_animal/hostile/mimic/copy/C = change + var/mob/living/simple_animal/hostile/mimic/copy/C = target C.ChangeOwner(firer) /obj/item/projectile/magic/spellblade