mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-14 00:23:29 +01:00
Adds two new event species
This commit is contained in:
@@ -0,0 +1,179 @@
|
||||
//separate dm since hydro is getting bloated already
|
||||
|
||||
/obj/effect/supermatter_crystal
|
||||
name = "supermatter growth"
|
||||
anchored = 1
|
||||
opacity = 0
|
||||
density = 0
|
||||
icon = 'icons/obj/lighting.dmi'
|
||||
icon_state = "supermatter_crystalf"
|
||||
layer = 2.1
|
||||
light_color = "#8A8A00"
|
||||
|
||||
var/endurance = 100
|
||||
var/delay = 1200
|
||||
var/floor = 0
|
||||
var/spreadChance = 10
|
||||
var/spreadIntoAdjacentChance = 10
|
||||
var/lastTick = 0
|
||||
var/spreaded = 1
|
||||
var/deleted = 0
|
||||
|
||||
/obj/effect/supermatter_crystal/single
|
||||
spreadChance = 0
|
||||
|
||||
/obj/effect/supermatter_crystal/New()
|
||||
..()
|
||||
light_color = "#8A8A00"
|
||||
|
||||
dir = CalcDir()
|
||||
|
||||
if(!floor)
|
||||
switch(dir) //offset to make it be on the wall rather than on the floor
|
||||
if(NORTH)
|
||||
pixel_y = 32
|
||||
if(SOUTH)
|
||||
pixel_y = -32
|
||||
if(EAST)
|
||||
pixel_x = 32
|
||||
if(WEST)
|
||||
pixel_x = -32
|
||||
icon_state = "supermatter_crystal"
|
||||
else
|
||||
if( prob( 10 )) // Only 10% of all floor crystals survive, so there's not a forest of 'em
|
||||
icon_state = "supermatter_crystalf"
|
||||
name = "supermatter crystal"
|
||||
density = 1
|
||||
else
|
||||
deleted = 1
|
||||
del( src )
|
||||
|
||||
processing_objects += src
|
||||
|
||||
set_light(3)
|
||||
lastTick = world.timeofday
|
||||
|
||||
/obj/effect/supermatter_crystal/Del()
|
||||
if( !deleted )
|
||||
visible_message("\red <B>\The [src] shatters!</B>")
|
||||
new /obj/item/weapon/shard/supermatter( src.loc )
|
||||
|
||||
processing_objects -= src
|
||||
..()
|
||||
|
||||
/obj/effect/supermatter_crystal/process()
|
||||
if(!spreaded)
|
||||
return
|
||||
|
||||
if(((world.timeofday - lastTick) > delay) || ((world.timeofday - lastTick) < 0))
|
||||
lastTick = world.timeofday
|
||||
spreaded = 0
|
||||
|
||||
for(var/mob/living/l in range( src, 2 ))
|
||||
var/rads = 5
|
||||
l.apply_effect(rads, IRRADIATE)
|
||||
|
||||
for(var/i=1,i<=3,i++)
|
||||
if(prob(spreadChance))
|
||||
var/list/possibleLocs = list()
|
||||
var/spreadsIntoAdjacent = 0
|
||||
|
||||
if(prob(spreadIntoAdjacentChance))
|
||||
spreadsIntoAdjacent = 1
|
||||
|
||||
for(var/turf/simulated/floor/floor in view(3,src))
|
||||
if(spreadsIntoAdjacent || !locate(/obj/effect/supermatter_crystal) in view(1,floor))
|
||||
possibleLocs += floor
|
||||
|
||||
if(!possibleLocs.len)
|
||||
break
|
||||
|
||||
var/turf/newLoc = pick(possibleLocs)
|
||||
|
||||
var/crystalCount = 0 //hacky
|
||||
var/placeCount = 1
|
||||
for(var/obj/effect/supermatter_crystal/shroom in newLoc)
|
||||
crystalCount++
|
||||
for(var/wallDir in cardinal)
|
||||
var/turf/isWall = get_step(newLoc,wallDir)
|
||||
if(isWall.density)
|
||||
placeCount++
|
||||
if(crystalCount >= placeCount)
|
||||
continue
|
||||
|
||||
var/obj/effect/supermatter_crystal/child = new /obj/effect/supermatter_crystal(newLoc)
|
||||
if( child )
|
||||
child.delay = delay
|
||||
child.endurance = endurance
|
||||
|
||||
spreaded++
|
||||
|
||||
/obj/effect/supermatter_crystal/proc/CalcDir(turf/location = loc)
|
||||
for(var/wallDir in cardinal)
|
||||
var/turf/newTurf = get_step(location,wallDir)
|
||||
if(newTurf.density)
|
||||
return wallDir
|
||||
|
||||
/*
|
||||
var/direction = 16
|
||||
|
||||
for(var/wallDir in cardinal)
|
||||
var/turf/newTurf = get_step(location,wallDir)
|
||||
if(newTurf.density)
|
||||
direction |= wallDir
|
||||
|
||||
for(var/obj/effect/supermatter_crystal/crystal in location)
|
||||
if(crystal == src)
|
||||
continue
|
||||
if(crystal.floor) //special
|
||||
direction &= ~16
|
||||
else
|
||||
direction &= ~crystal.dir
|
||||
|
||||
var/list/dirList = list()
|
||||
|
||||
for(var/i=1,i<=16,i <<= 1)
|
||||
if(direction & i)
|
||||
dirList += i
|
||||
|
||||
if(dirList.len)
|
||||
var/newDir = pick(dirList)
|
||||
if(newDir == 16)
|
||||
floor = 1
|
||||
newDir = 1
|
||||
return newDir
|
||||
*/
|
||||
floor = 1
|
||||
return 1
|
||||
|
||||
/obj/effect/supermatter_crystal/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
|
||||
endurance -= W.force
|
||||
|
||||
CheckEndurance()
|
||||
|
||||
/obj/effect/supermatter_crystal/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
del(src)
|
||||
return
|
||||
if(3.0)
|
||||
if (prob(5))
|
||||
del(src)
|
||||
return
|
||||
else
|
||||
return
|
||||
|
||||
/obj/effect/supermatter_crystal/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
|
||||
if(exposed_temperature > 300)
|
||||
endurance -= 5
|
||||
CheckEndurance()
|
||||
|
||||
/obj/effect/supermatter_crystal/proc/CheckEndurance()
|
||||
if(endurance <= 0)
|
||||
del(src)
|
||||
@@ -0,0 +1,103 @@
|
||||
|
||||
/obj/item/weapon/shard/supermatter
|
||||
name = "supermatter shard"
|
||||
desc = "A shard of supermatter. Incredibly dangerous, though not large enough to go critical."
|
||||
force = 10.0
|
||||
throwforce = 20.0
|
||||
icon_state = "supermatter"
|
||||
sharp = 1
|
||||
edge = 1
|
||||
w_class = 2
|
||||
flags = CONDUCT
|
||||
light_color = "#8A8A00"
|
||||
var/brightness = 2
|
||||
|
||||
/obj/item/weapon/shard/supermatter/New()
|
||||
src.icon_state = pick("supermatter")
|
||||
switch(src.icon_state)
|
||||
if("supermattersmall")
|
||||
src.pixel_x = rand(-12, 12)
|
||||
src.pixel_y = rand(-12, 12)
|
||||
if("supermattermedium")
|
||||
src.pixel_x = rand(-8, 8)
|
||||
src.pixel_y = rand(-8, 8)
|
||||
if("supermatterlarge")
|
||||
src.pixel_x = rand(-5, 5)
|
||||
src.pixel_y = rand(-5, 5)
|
||||
else
|
||||
|
||||
set_light(brightness)
|
||||
|
||||
/obj/item/weapon/shard/supermatter/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if( istype( W, /obj/item/weapon/tongs ))
|
||||
var/obj/item/weapon/tongs/T = W
|
||||
T.pick_up( src )
|
||||
T.icon_state = "tongs_supermatter"
|
||||
return
|
||||
|
||||
..()
|
||||
|
||||
/obj/item/weapon/shard/supermatter/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
|
||||
playsound(loc, 'sound/weapons/bladeslice.ogg', 50, 1, -1)
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/shard/supermatter/Crossed(AM as mob|obj)
|
||||
if(ismob(AM))
|
||||
var/mob/M = AM
|
||||
M << "\red <B>You step on \the [src]!</B>"
|
||||
playsound(src.loc, 'sound/effects/glass_step_sm.ogg', 70, 1) // not sure how to handle metal shards with sounds
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
|
||||
if(H.species.flags & IS_SYNTHETIC) //Thick skin.
|
||||
return
|
||||
|
||||
if( !H.shoes && ( !H.wear_suit || !(H.wear_suit.body_parts_covered & FEET) ) )
|
||||
var/obj/item/organ/external/affecting = H.get_organ(pick("l_foot", "r_foot"))
|
||||
if(affecting.status & ORGAN_ROBOT)
|
||||
return
|
||||
if(affecting.take_damage(5, 20))
|
||||
H.UpdateDamageIcon()
|
||||
H.updatehealth()
|
||||
if(!(H.species && (H.species.flags & NO_PAIN)))
|
||||
H.Weaken(3)
|
||||
..()
|
||||
|
||||
|
||||
/obj/item/weapon/shard/supermatter/attack_hand(var/mob/user)
|
||||
if(!istype(user,/mob/living/carbon/human/nucleation))
|
||||
user << pick( "\red You think twice before touching that without protection.",
|
||||
"\red You don't want to touch that without some protection.",
|
||||
"\red You probably should get something else to pick that up.",
|
||||
"\red You aren't sure that's a good idea.",
|
||||
"\red You aren't in the mood to get vaporized today.",
|
||||
"\red You really don't feel like frying your hand off.",
|
||||
"\red You assume that's a bad idea." )
|
||||
return
|
||||
|
||||
..()
|
||||
|
||||
/obj/item/weapon/tongs
|
||||
name = "tongs"
|
||||
desc = "Tungsten-alloy tongs used for handling dangerous materials."
|
||||
force = 7.0
|
||||
throwforce = 12.0
|
||||
icon = 'icons/obj/weapons.dmi'
|
||||
icon_state = "tongs"
|
||||
edge = 1
|
||||
w_class = 2
|
||||
flags = CONDUCT
|
||||
var/obj/item/held = null // The item currently being held
|
||||
|
||||
/obj/item/weapon/tongs/proc/pick_up( var/obj/item/I )
|
||||
held = I
|
||||
I.loc = src
|
||||
playsound(loc, 'sound/effects/tong_pickup.ogg', 50, 1, -1)
|
||||
|
||||
/obj/item/weapon/tongs/attack_self(var/mob/user as mob)
|
||||
if( held )
|
||||
var/turf/T = get_turf(user.loc)
|
||||
held.loc = T
|
||||
held = null
|
||||
icon_state = initial(icon_state)
|
||||
..()
|
||||
@@ -117,14 +117,33 @@
|
||||
icon_state = "cutters-y"
|
||||
item_state = "cutters_yellow"
|
||||
|
||||
/obj/item/weapon/wirecutters/attack(mob/living/carbon/C as mob, mob/user as mob)
|
||||
if((C.handcuffed) && (istype(C.handcuffed, /obj/item/weapon/restraints/handcuffs/cable)))
|
||||
usr.visible_message("\The [usr] cuts \the [C]'s restraints with \the [src]!",\
|
||||
"You cut \the [C]'s restraints with \the [src]!",\
|
||||
"You hear cable being cut.")
|
||||
C.handcuffed = null
|
||||
C.update_inv_handcuffed()
|
||||
return
|
||||
/obj/item/weapon/wirecutters/attack(mob/living/carbon/human/C as mob, mob/user as mob)
|
||||
if(C.handcuffed)
|
||||
if(C.species.name == "Wryn" && (locate(C.internal_organs_by_name["antennae"]) in C.internal_organs))
|
||||
|
||||
var/turf/p_loc = user.loc
|
||||
var/turf/p_loc_m = C.loc
|
||||
|
||||
user.visible_message("\blue [user] begins to cut off [C]'s antennae.")
|
||||
C << "\red <B>[user] begins to cut off your antennae!<B>"
|
||||
do_after(C, 150)
|
||||
if(p_loc == user.loc && p_loc_m == C.loc)
|
||||
del(C.internal_organs_by_name["antennae"])
|
||||
C.remove_language("Wryn Hivemind")
|
||||
new /obj/item/organ/wryn/hivenode(user.loc)
|
||||
user << "\blue You hear a loud crunch as you mercilessly off cut [C]'s antennae."
|
||||
C << "\red <B>You hear a loud crunch as the wirecutters rip through your antennae.</B>"
|
||||
C << "\red <B>Its so quiet...</B>"
|
||||
C.h_style = "Bald"
|
||||
C.update_hair()
|
||||
else
|
||||
if(istype(C.handcuffed, /obj/item/weapon/restraints/handcuffs/cable))
|
||||
usr.visible_message("\The [usr] cuts \the [C]'s restraints with \the [src]!",\
|
||||
"You cut \the [C]'s restraints with \the [src]!",\
|
||||
"You hear cable being cut.")
|
||||
C.handcuffed = null
|
||||
C.update_inv_handcuffed()
|
||||
return
|
||||
else
|
||||
..()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user