moving all the git stuff over to this so people who don't want to spend 8 years figuring out the bass ackward git system can actually run our server code

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2983 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
quartz235@gmail.com
2012-01-25 05:05:55 +00:00
parent cbe487dbd5
commit b3f7865754
82 changed files with 21831 additions and 21392 deletions
+6
View File
@@ -20,6 +20,9 @@
for(var/obj/item/I in src)
I.loc = src.loc
for(var/obj/mecha/working/ripley/deathripley/I in src)
I.loc = src.loc
for(var/mob/M in src)
M.loc = src.loc
if(M.client)
@@ -54,6 +57,9 @@
if(!I.anchored)
I.loc = src
for(var/obj/mecha/working/ripley/deathripley/I in src.loc)
I.loc = src
for(var/mob/M in src.loc)
if(istype (M, /mob/dead/observer))
continue
+20
View File
@@ -0,0 +1,20 @@
/obj/structure/closet/secure_closet/cargotech
name = "Cargo Technician's Locker"
req_access = list(access_cargo)
//icon_state = "secureeng1"
//icon_closed = "secureeng"
//icon_locked = "secureeng1"
//icon_opened = "toolclosetopen"
//icon_broken = "secureengbroken"
//icon_off = "secureengoff"
//Needs proper sprites
New()
..()
sleep(2)
new /obj/item/clothing/under/rank/cargo(src)
new /obj/item/clothing/shoes/brown(src)
new /obj/item/device/radio/headset/headset_cargo(src)
new /obj/item/clothing/gloves/black(src)
return
+1 -1
View File
@@ -745,7 +745,7 @@
if(istype(C, /mob/living/carbon/human))
var/mob/living/carbon/human/H = C
var/list/damaged = H.get_damaged_organs(1,1)
user.show_message("\blue Localized Damage, Brute-Burn:",1)
user.show_message("\blue Localized Damage, Brute/Burn:",1)
if(length(damaged)>0)
for(var/datum/organ/external/org in damaged)
user.show_message(text("\blue \t []: []\blue-[]",capitalize(org.getDisplayName()),(org.brute_dam > 0)?"\red [org.brute_dam]":0,(org.burn_dam > 0)?"\red [org.burn_dam]":0),1)
+1 -1
View File
@@ -208,7 +208,7 @@ MASS SPECTROMETER
if(mode == 1 && istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M
var/list/damaged = H.get_damaged_organs(1,1)
user.show_message("\blue Localized Damage, Brute\\Burn:",1)
user.show_message("\blue Localized Damage, Brute/Burn:",1)
if(length(damaged)>0)
for(var/datum/organ/external/org in damaged)
user.show_message(text("\blue \t []: []\blue-[]",capitalize(org.getDisplayName()),(org.brute_dam > 0)?"\red [org.brute_dam]":0,(org.burn_dam > 0)?"\red [org.burn_dam]":0),1)
+266 -266
View File
@@ -1,267 +1,267 @@
/obj/item/blueprints
var/const/AREA_ERRNONE = 0
var/const/AREA_STATION = 1
var/const/AREA_SPACE = 2
var/const/AREA_SPECIAL = 3
var/const/BORDER_ERROR = 0
var/const/BORDER_NONE = 1
var/const/BORDER_BETWEEN = 2
var/const/BORDER_2NDTILE = 3
var/const/BORDER_SPACE = 4
var/const/ROOM_ERR_LOLWAT = 0
var/const/ROOM_ERR_SPACE = -1
var/const/ROOM_ERR_TOOLARGE = -2
/obj/item/blueprints/attack_self(mob/M as mob)
if (!istype(M,/mob/living/carbon/human))
M << "This is stack of useless pieces of harsh paper." //monkeys cannot into projecting
return
interact()
return
/obj/item/blueprints/Topic(href, href_list)
..()
if ((usr.restrained() || usr.stat || usr.equipped() != src))
return
if (!href_list["action"])
return
switch(href_list["action"])
if ("create_area")
if (get_area_type()!=AREA_SPACE)
interact()
return
create_area()
if ("edit_area")
if (get_area_type()!=AREA_STATION)
interact()
return
edit_area()
/obj/item/blueprints/proc/interact()
var/area/A = get_area()
var/text = {"<HTML><head><title>[src]</title></head><BODY>
<h2>[station_name()] blueprints</h2>
<small>Property of Nanotrasen. For heads of staff only. Store in high-secure storage.</small><hr>
"}
switch (get_area_type())
if (AREA_SPACE)
text += {"
<p>According this blueprints you are in <b>open space</b> now.</p>
<p><a href='?src=\ref[src];action=create_area'>Mark this place as new area.</a></p>
"}
if (AREA_STATION)
text += {"
<p>According this blueprints you are in <b>[A.name]</b> now.</p>
<p>You may <a href='?src=\ref[src];action=edit_area'>
move an amendment</a> to the drawing.</p>
"}
if (AREA_SPECIAL)
text += {"
<p>This place doesn't noted on this blueprints.</p>
"}
else
return
text += "</BODY></HTML>"
usr << browse(text, "window=blueprints")
onclose(usr, "blueprints")
/obj/item/blueprints/proc/get_area()
var/turf/T = get_turf_loc(usr)
var/area/A = T.loc
A = A.master
return A
/obj/item/blueprints/proc/get_area_type(var/area/A = get_area())
if (A.name == "Space")
return AREA_SPACE
var/list/SPECIALS = list(
/area/shuttle,
/area/admin,
/area/arrival,
/area/centcom,
/area/asteroid,
/area/tdome,
/area/syndicate_station,
/area/wizard_station,
/area/prison
// /area/derelict //commented out, all hail derelict-rebuilders!
)
for (var/type in SPECIALS)
if ( istype(A,type) )
return AREA_SPECIAL
return AREA_STATION
/obj/item/blueprints/proc/create_area()
//world << "DEBUG: create_area"
var/res = detect_room(get_turf_loc(usr))
if(!istype(res,/list))
switch(res)
if(ROOM_ERR_SPACE)
usr << "\red New area must be complete airtight!"
return
if(ROOM_ERR_TOOLARGE)
usr << "\red New area too large!"
return
else
usr << "\red Error! Please notify administration!"
return
var/list/turf/turfs = res
var/str = sanitize(trim(input(usr,"New area title","Blueprints editing")))
if(!str || !length(str)) //cancel
return
if(length(str) > 50)
usr << "\red Text too long."
return
var/area/A = new
A.name = str
A.tag="[A.type]_[md5(str)]" // without this dynamic light system ruin everithing
//var/ma
//ma = A.master ? "[A.master]" : "(null)"
//world << "DEBUG: create_area: <br>A.name=[A.name]<br>A.tag=[A.tag]<br>A.master=[ma]"
A.power_equip = 0
A.power_light = 0
A.power_environ = 0
move_turfs_to_area(turfs, A)
spawn(5)
//ma = A.master ? "[A.master]" : "(null)"
//world << "DEBUG: create_area(5): <br>A.name=[A.name]<br>A.tag=[A.tag]<br>A.master=[ma]"
interact()
return
/obj/item/blueprints/proc/move_turfs_to_area(var/list/turf/turfs, var/area/A)
A.contents.Add(turfs)
//oldarea.contents.Remove(usr.loc) // not needed
//T.loc = A //error: cannot change constant value
/obj/item/blueprints/proc/edit_area()
var/area/A = get_area()
//world << "DEBUG: edit_area"
var/prevname = A.name
var/str = sanitize(trim(input(usr,"New area title","Blueprints editing",prevname)))
if(!str || !length(str) || str==prevname) //cancel
return
if(length(str) > 50)
usr << "\red Text too long."
return
set_area_machinery_title(A,str,prevname)
for(var/area/RA in A.related)
RA.name = str
usr << "\blue You set the area '[prevname]' title to '[str]'."
interact()
return
/obj/item/blueprints/proc/set_area_machinery_title(var/area/A,var/title,var/oldtitle)
if (!oldtitle) // or dd_replacetext goes to infinite loop
return
for(var/area/RA in A.related)
for(var/obj/machinery/alarm/M in RA)
M.name = dd_replacetext(M.name,oldtitle,title)
for(var/obj/machinery/power/apc/M in RA)
M.name = dd_replacetext(M.name,oldtitle,title)
for(var/obj/machinery/atmospherics/unary/vent_scrubber/M in RA)
M.name = dd_replacetext(M.name,oldtitle,title)
for(var/obj/machinery/atmospherics/unary/vent_pump/M in RA)
M.name = dd_replacetext(M.name,oldtitle,title)
for(var/obj/machinery/door/M in RA)
M.name = dd_replacetext(M.name,oldtitle,title)
//TODO: much much more. Unnamed airlocks, cameras, etc.
/obj/item/blueprints/proc/check_tile_is_border(var/turf/T2,var/dir)
if (istype(T2, /turf/space))
return BORDER_SPACE //omg hull breach we all going to die here
if (istype(T2, /turf/simulated/shuttle))
return BORDER_SPACE
if (get_area_type(T2.loc)!=AREA_SPACE)
return BORDER_BETWEEN
if (istype(T2, /turf/simulated/wall))
return BORDER_2NDTILE
if (!istype(T2, /turf/simulated))
return BORDER_BETWEEN
for (var/obj/structure/window/W in T2)
if(turn(dir,180) == W.dir)
return BORDER_BETWEEN
if (W.dir in list(NORTHEAST,SOUTHEAST,NORTHWEST,SOUTHWEST))
return BORDER_2NDTILE
for(var/obj/machinery/door/window/D in T2)
if(turn(dir,180) == D.dir)
return BORDER_BETWEEN
if (locate(/obj/machinery/door) in T2)
return BORDER_2NDTILE
if (locate(/obj/structure/falsewall) in T2)
return BORDER_2NDTILE
if (locate(/obj/structure/falserwall) in T2)
return BORDER_2NDTILE
return BORDER_NONE
/obj/item/blueprints/proc/detect_room(var/turf/first)
var/list/turf/found = new
var/list/turf/pending = list(first)
while(pending.len)
if (found.len+pending.len > 300)
return ROOM_ERR_TOOLARGE
var/turf/T = pending[1] //why byond havent list::pop()?
pending -= T
for (var/dir in cardinal)
var/skip = 0
for (var/obj/structure/window/W in T)
if(dir == W.dir || (W.dir in list(NORTHEAST,SOUTHEAST,NORTHWEST,SOUTHWEST)))
skip = 1; break
if (skip) continue
for(var/obj/machinery/door/window/D in T)
if(dir == D.dir)
skip = 1; break
if (skip) continue
var/turf/NT = get_step(T,dir)
if (!isturf(NT) || (NT in found) || (NT in pending))
continue
switch(check_tile_is_border(NT,dir))
if(BORDER_NONE)
pending+=NT
if(BORDER_BETWEEN)
//do nothing, may be later i'll add 'rejected' list as optimization
if(BORDER_2NDTILE)
found+=NT //tile included to new area, but we dont seek more
if(BORDER_SPACE)
return ROOM_ERR_SPACE
found+=T
return found
/*
/proc/check_apc(var/area/A)
for(var/area/RA in A.related)
for(var/obj/machinery/power/apc/FINDME in RA)
return 1
return 0
/proc/fuckingfreemachinery()
for(var/obj/machinery/machine in machines)
if (istype(machine,/obj/machinery/power/solar))
continue
var/area/A = machine.loc.loc // make sure it's in an area
if (istype(A,/area/tdome))
continue
if (istype(A,/area/shuttle))
continue
if(!A || !isarea(A))
world << "DEBUG: @[machine.x],[machine.y],[machine.z] ([A.name]) machine \"[machine.name]\" ([machine.type]) hasnt area!"
continue
A = A.master
if (A.name=="Space")
world << "DEBUG: @[machine.x],[machine.y],[machine.z] ([A.name]) machine \"[machine.name]\" ([machine.type]) work in space!"
continue
if (!check_apc(A))
world << "DEBUG: @[machine.x],[machine.y],[machine.z] ([A.name]) machine \"[machine.name]\" ([machine.type]) work without APC!"
world << "\red END ====="
/obj/item/blueprints
var/const/AREA_ERRNONE = 0
var/const/AREA_STATION = 1
var/const/AREA_SPACE = 2
var/const/AREA_SPECIAL = 3
var/const/BORDER_ERROR = 0
var/const/BORDER_NONE = 1
var/const/BORDER_BETWEEN = 2
var/const/BORDER_2NDTILE = 3
var/const/BORDER_SPACE = 4
var/const/ROOM_ERR_LOLWAT = 0
var/const/ROOM_ERR_SPACE = -1
var/const/ROOM_ERR_TOOLARGE = -2
/obj/item/blueprints/attack_self(mob/M as mob)
if (!istype(M,/mob/living/carbon/human))
M << "This is stack of useless pieces of harsh paper." //monkeys cannot into projecting
return
interact()
return
/obj/item/blueprints/Topic(href, href_list)
..()
if ((usr.restrained() || usr.stat || usr.equipped() != src))
return
if (!href_list["action"])
return
switch(href_list["action"])
if ("create_area")
if (get_area_type()!=AREA_SPACE)
interact()
return
create_area()
if ("edit_area")
if (get_area_type()!=AREA_STATION)
interact()
return
edit_area()
/obj/item/blueprints/proc/interact()
var/area/A = get_area()
var/text = {"<HTML><head><title>[src]</title></head><BODY>
<h2>[station_name()] blueprints</h2>
<small>Property of Nanotrasen. For heads of staff only. Store in high-secure storage.</small><hr>
"}
switch (get_area_type())
if (AREA_SPACE)
text += {"
<p>According this blueprints you are in <b>open space</b> now.</p>
<p><a href='?src=\ref[src];action=create_area'>Mark this place as new area.</a></p>
"}
if (AREA_STATION)
text += {"
<p>According this blueprints you are in <b>[A.name]</b> now.</p>
<p>You may <a href='?src=\ref[src];action=edit_area'>
move an amendment</a> to the drawing.</p>
"}
if (AREA_SPECIAL)
text += {"
<p>This place doesn't noted on this blueprints.</p>
"}
else
return
text += "</BODY></HTML>"
usr << browse(text, "window=blueprints")
onclose(usr, "blueprints")
/obj/item/blueprints/proc/get_area()
var/turf/T = get_turf_loc(usr)
var/area/A = T.loc
A = A.master
return A
/obj/item/blueprints/proc/get_area_type(var/area/A = get_area())
if (A.name == "Space")
return AREA_SPACE
var/list/SPECIALS = list(
/area/shuttle,
/area/admin,
/area/arrival,
/area/centcom,
/area/asteroid,
/area/tdome,
/area/syndicate_station,
/area/wizard_station,
/area/prison
// /area/derelict //commented out, all hail derelict-rebuilders!
)
for (var/type in SPECIALS)
if ( istype(A,type) )
return AREA_SPECIAL
return AREA_STATION
/obj/item/blueprints/proc/create_area()
//world << "DEBUG: create_area"
var/res = detect_room(get_turf_loc(usr))
if(!istype(res,/list))
switch(res)
if(ROOM_ERR_SPACE)
usr << "\red New area must be complete airtight!"
return
if(ROOM_ERR_TOOLARGE)
usr << "\red New area too large!"
return
else
usr << "\red Error! Please notify administration!"
return
var/list/turf/turfs = res
var/str = sanitize(trim(input(usr,"New area title","Blueprints editing")))
if(!str || !length(str)) //cancel
return
if(length(str) > 50)
usr << "\red Text too long."
return
var/area/A = new
A.name = str
A.tag="[A.type]_[md5(str)]" // without this dynamic light system ruin everithing
//var/ma
//ma = A.master ? "[A.master]" : "(null)"
//world << "DEBUG: create_area: <br>A.name=[A.name]<br>A.tag=[A.tag]<br>A.master=[ma]"
A.power_equip = 0
A.power_light = 0
A.power_environ = 0
move_turfs_to_area(turfs, A)
spawn(5)
//ma = A.master ? "[A.master]" : "(null)"
//world << "DEBUG: create_area(5): <br>A.name=[A.name]<br>A.tag=[A.tag]<br>A.master=[ma]"
interact()
return
/obj/item/blueprints/proc/move_turfs_to_area(var/list/turf/turfs, var/area/A)
A.contents.Add(turfs)
//oldarea.contents.Remove(usr.loc) // not needed
//T.loc = A //error: cannot change constant value
/obj/item/blueprints/proc/edit_area()
var/area/A = get_area()
//world << "DEBUG: edit_area"
var/prevname = A.name
var/str = sanitize(trim(input(usr,"New area title","Blueprints editing",prevname)))
if(!str || !length(str) || str==prevname) //cancel
return
if(length(str) > 50)
usr << "\red Text too long."
return
set_area_machinery_title(A,str,prevname)
for(var/area/RA in A.related)
RA.name = str
usr << "\blue You set the area '[prevname]' title to '[str]'."
interact()
return
/obj/item/blueprints/proc/set_area_machinery_title(var/area/A,var/title,var/oldtitle)
if (!oldtitle) // or dd_replacetext goes to infinite loop
return
for(var/area/RA in A.related)
for(var/obj/machinery/alarm/M in RA)
M.name = dd_replacetext(M.name,oldtitle,title)
for(var/obj/machinery/power/apc/M in RA)
M.name = dd_replacetext(M.name,oldtitle,title)
for(var/obj/machinery/atmospherics/unary/vent_scrubber/M in RA)
M.name = dd_replacetext(M.name,oldtitle,title)
for(var/obj/machinery/atmospherics/unary/vent_pump/M in RA)
M.name = dd_replacetext(M.name,oldtitle,title)
for(var/obj/machinery/door/M in RA)
M.name = dd_replacetext(M.name,oldtitle,title)
//TODO: much much more. Unnamed airlocks, cameras, etc.
/obj/item/blueprints/proc/check_tile_is_border(var/turf/T2,var/dir)
if (istype(T2, /turf/space))
return BORDER_SPACE //omg hull breach we all going to die here
if (istype(T2, /turf/simulated/shuttle))
return BORDER_SPACE
if (get_area_type(T2.loc)!=AREA_SPACE)
return BORDER_BETWEEN
if (istype(T2, /turf/simulated/wall))
return BORDER_2NDTILE
if (!istype(T2, /turf/simulated))
return BORDER_BETWEEN
for (var/obj/structure/window/W in T2)
if(turn(dir,180) == W.dir)
return BORDER_BETWEEN
if (W.dir in list(NORTHEAST,SOUTHEAST,NORTHWEST,SOUTHWEST))
return BORDER_2NDTILE
for(var/obj/machinery/door/window/D in T2)
if(turn(dir,180) == D.dir)
return BORDER_BETWEEN
if (locate(/obj/machinery/door) in T2)
return BORDER_2NDTILE
if (locate(/obj/structure/falsewall) in T2)
return BORDER_2NDTILE
if (locate(/obj/structure/falserwall) in T2)
return BORDER_2NDTILE
return BORDER_NONE
/obj/item/blueprints/proc/detect_room(var/turf/first)
var/list/turf/found = new
var/list/turf/pending = list(first)
while(pending.len)
if (found.len+pending.len > 300)
return ROOM_ERR_TOOLARGE
var/turf/T = pending[1] //why byond havent list::pop()?
pending -= T
for (var/dir in cardinal)
var/skip = 0
for (var/obj/structure/window/W in T)
if(dir == W.dir || (W.dir in list(NORTHEAST,SOUTHEAST,NORTHWEST,SOUTHWEST)))
skip = 1; break
if (skip) continue
for(var/obj/machinery/door/window/D in T)
if(dir == D.dir)
skip = 1; break
if (skip) continue
var/turf/NT = get_step(T,dir)
if (!isturf(NT) || (NT in found) || (NT in pending))
continue
switch(check_tile_is_border(NT,dir))
if(BORDER_NONE)
pending+=NT
if(BORDER_BETWEEN)
//do nothing, may be later i'll add 'rejected' list as optimization
if(BORDER_2NDTILE)
found+=NT //tile included to new area, but we dont seek more
if(BORDER_SPACE)
return ROOM_ERR_SPACE
found+=T
return found
/*
/proc/check_apc(var/area/A)
for(var/area/RA in A.related)
for(var/obj/machinery/power/apc/FINDME in RA)
return 1
return 0
/proc/fuckingfreemachinery()
for(var/obj/machinery/machine in machines)
if (istype(machine,/obj/machinery/power/solar))
continue
var/area/A = machine.loc.loc // make sure it's in an area
if (istype(A,/area/tdome))
continue
if (istype(A,/area/shuttle))
continue
if(!A || !isarea(A))
world << "DEBUG: @[machine.x],[machine.y],[machine.z] ([A.name]) machine \"[machine.name]\" ([machine.type]) hasnt area!"
continue
A = A.master
if (A.name=="Space")
world << "DEBUG: @[machine.x],[machine.y],[machine.z] ([A.name]) machine \"[machine.name]\" ([machine.type]) work in space!"
continue
if (!check_apc(A))
world << "DEBUG: @[machine.x],[machine.y],[machine.z] ([A.name]) machine \"[machine.name]\" ([machine.type]) work without APC!"
world << "\red END ====="
*/
@@ -307,6 +307,14 @@
<li>Install the external reinforced armor plating (Not included due to Nanotrasen regulations. Can be made using 5 reinforced metal sheets.)</li>
<li>Secure the external reinforced armor plating with a wrench</li>
<li>Weld the external reinforced armor plating to the chassis</li>
<li></li>
<li>Additional Information:</li>
<li>The firefighting variation is made in a similar fashion.</li>
<li>A firesuit must be connected to the Firefighter chassis for heat shielding.</li>
<li>Internal armor is plasteel for additional strength.</li>
<li>External armor must be installed in 2 parts, totaling 10 sheets.</li>
<li>Completed mech is more resiliant against fire, and is a bit more durable overall</li>
<li>Nanotrasen is determined to the safety of its <s>investments</s> employees.</li>
</ol>
</body>
</html>
+1 -1
View File
@@ -6,7 +6,7 @@
icon_state = "plantbag"
name = "Plant Bag"
var/mode = 1; //0 = pick one at a time, 1 = pick all on tile
var/capacity = 10; //the number of plant pieces it can carry.
var/capacity = 50; //the number of plant pieces it can carry.
flags = FPRINT | TABLEPASS | ONBELT
w_class = 1
+136 -136
View File
@@ -1,137 +1,137 @@
/obj/effect/new_year_tree
name = "The fir"
desc = "This is a fir. Real fir on dammit spess station. You smell pine-needles."
icon = '160x160.dmi'
icon_state = "new-year-tree"
anchored = 1
opacity = 1
density = 1
layer = 5
pixel_x = -64
//pixel_y = -64
/obj/effect/new_year_tree/attackby(obj/item/W, mob/user)
if (istype(W, /obj/item/weapon/grab))
return
W.loc = src
if (user.client)
user.client.screen -= W
user.u_equip(W)
var/const/bottom_right_x = 115.0
var/const/bottom_right_y = 150.0
var/const/top_left_x = 15.0
var/const/top_left_y = 15.0
var/const/bottom_med_x = top_left_x+(bottom_right_x-top_left_x)/2
var/x = rand(top_left_x,bottom_med_x) //point in half of circumscribing rectangle
var/y = rand(top_left_y,bottom_right_y)
/*
y1=a*x1+b
y2=a*x2+b b = y2-a*x2
y1=a*x1+ y2-a*x2
a*(x1-x2)+y2-y1=0
a = (y1-y2)/(x1-x2)
*/
var/a = (top_left_y-bottom_right_y)/(top_left_x-bottom_med_x)
var/b = bottom_right_y-a*bottom_med_x
if (a*x+b < y) //if point is above diagonal top_left -> bottom_median
x = bottom_med_x + x - top_left_x
y = bottom_right_y - y + top_left_y
var/image/I = image(W.icon, W, icon_state = W.icon_state)
I.pixel_x = x
I.pixel_y = y
overlays += I
/obj/item/weapon/firbang
desc = "It is set to detonate in 10 seconds."
name = "firbang"
icon = 'grenade.dmi'
icon_state = "flashbang"
var/state = null
var/det_time = 100.0
w_class = 2.0
item_state = "flashbang"
throw_speed = 4
throw_range = 20
flags = FPRINT | TABLEPASS | CONDUCT | ONBELT
/obj/item/weapon/firbang/afterattack(atom/target as mob|obj|turf|area, mob/user as mob)
if (user.equipped() == src)
if ((user.mutations & CLUMSY) && prob(50))
user << "\red Huh? How does this thing work?!"
src.state = 1
src.icon_state = "flashbang1"
playsound(src.loc, 'armbomb.ogg', 75, 1, -3)
spawn( 5 )
prime()
return
else if (!( src.state ))
user << "\red You prime the [src]! [det_time/10] seconds!"
src.state = 1
src.icon_state = "flashbang1"
playsound(src.loc, 'armbomb.ogg', 75, 1, -3)
spawn( src.det_time )
prime()
return
user.dir = get_dir(user, target)
user.drop_item()
var/t = (isturf(target) ? target : target.loc)
walk_towards(src, t, 3)
src.add_fingerprint(user)
return
/obj/item/weapon/firbang/attack_paw(mob/user as mob)
return src.attack_hand(user)
/obj/item/weapon/firbang/attack_hand()
walk(src, null, null)
..()
return
/obj/item/weapon/firbang/proc/prime()
playsound(src.loc, 'bang.ogg', 25, 1)
var/turf/T = get_turf(src)
if(T)
var/datum/effect/effect/system/harmless_smoke_spread/smoke = new
smoke.set_up(3, 0, src.loc)
smoke.attach(src)
smoke.start()
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(3, 1, src)
s.start()
new /obj/effect/new_year_tree(T)
del(src)
return
/obj/item/weapon/firbang/attack_self(mob/user as mob)
if (!src.state)
if (user.mutations & CLUMSY)
user << "\red Huh? How does this thing work?!"
spawn( 5 )
prime()
return
else
user << "\red You prime the [src]! [det_time/10] seconds!"
src.state = 1
src.icon_state = "flashbang1"
add_fingerprint(user)
spawn( src.det_time )
prime()
return
return
/*
/datum/supply_packs/new_year
name = "New Year Celebration Equipment"
contains = list("/obj/item/weapon/firbang",
"/obj/item/weapon/firbang",
"/obj/item/weapon/firbang",
"/obj/item/weapon/wrapping_paper",
"/obj/item/weapon/wrapping_paper",
"/obj/item/weapon/wrapping_paper")
cost = 20
containertype = "/obj/structure/closet/crate"
containername = "New Year Celebration crate"
/obj/effect/new_year_tree
name = "The fir"
desc = "This is a fir. Real fir on dammit spess station. You smell pine-needles."
icon = '160x160.dmi'
icon_state = "new-year-tree"
anchored = 1
opacity = 1
density = 1
layer = 5
pixel_x = -64
//pixel_y = -64
/obj/effect/new_year_tree/attackby(obj/item/W, mob/user)
if (istype(W, /obj/item/weapon/grab))
return
W.loc = src
if (user.client)
user.client.screen -= W
user.u_equip(W)
var/const/bottom_right_x = 115.0
var/const/bottom_right_y = 150.0
var/const/top_left_x = 15.0
var/const/top_left_y = 15.0
var/const/bottom_med_x = top_left_x+(bottom_right_x-top_left_x)/2
var/x = rand(top_left_x,bottom_med_x) //point in half of circumscribing rectangle
var/y = rand(top_left_y,bottom_right_y)
/*
y1=a*x1+b
y2=a*x2+b b = y2-a*x2
y1=a*x1+ y2-a*x2
a*(x1-x2)+y2-y1=0
a = (y1-y2)/(x1-x2)
*/
var/a = (top_left_y-bottom_right_y)/(top_left_x-bottom_med_x)
var/b = bottom_right_y-a*bottom_med_x
if (a*x+b < y) //if point is above diagonal top_left -> bottom_median
x = bottom_med_x + x - top_left_x
y = bottom_right_y - y + top_left_y
var/image/I = image(W.icon, W, icon_state = W.icon_state)
I.pixel_x = x
I.pixel_y = y
overlays += I
/obj/item/weapon/firbang
desc = "It is set to detonate in 10 seconds."
name = "firbang"
icon = 'grenade.dmi'
icon_state = "flashbang"
var/state = null
var/det_time = 100.0
w_class = 2.0
item_state = "flashbang"
throw_speed = 4
throw_range = 20
flags = FPRINT | TABLEPASS | CONDUCT | ONBELT
/obj/item/weapon/firbang/afterattack(atom/target as mob|obj|turf|area, mob/user as mob)
if (user.equipped() == src)
if ((user.mutations & CLUMSY) && prob(50))
user << "\red Huh? How does this thing work?!"
src.state = 1
src.icon_state = "flashbang1"
playsound(src.loc, 'armbomb.ogg', 75, 1, -3)
spawn( 5 )
prime()
return
else if (!( src.state ))
user << "\red You prime the [src]! [det_time/10] seconds!"
src.state = 1
src.icon_state = "flashbang1"
playsound(src.loc, 'armbomb.ogg', 75, 1, -3)
spawn( src.det_time )
prime()
return
user.dir = get_dir(user, target)
user.drop_item()
var/t = (isturf(target) ? target : target.loc)
walk_towards(src, t, 3)
src.add_fingerprint(user)
return
/obj/item/weapon/firbang/attack_paw(mob/user as mob)
return src.attack_hand(user)
/obj/item/weapon/firbang/attack_hand()
walk(src, null, null)
..()
return
/obj/item/weapon/firbang/proc/prime()
playsound(src.loc, 'bang.ogg', 25, 1)
var/turf/T = get_turf(src)
if(T)
var/datum/effect/effect/system/harmless_smoke_spread/smoke = new
smoke.set_up(3, 0, src.loc)
smoke.attach(src)
smoke.start()
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(3, 1, src)
s.start()
new /obj/effect/new_year_tree(T)
del(src)
return
/obj/item/weapon/firbang/attack_self(mob/user as mob)
if (!src.state)
if (user.mutations & CLUMSY)
user << "\red Huh? How does this thing work?!"
spawn( 5 )
prime()
return
else
user << "\red You prime the [src]! [det_time/10] seconds!"
src.state = 1
src.icon_state = "flashbang1"
add_fingerprint(user)
spawn( src.det_time )
prime()
return
return
/*
/datum/supply_packs/new_year
name = "New Year Celebration Equipment"
contains = list("/obj/item/weapon/firbang",
"/obj/item/weapon/firbang",
"/obj/item/weapon/firbang",
"/obj/item/weapon/wrapping_paper",
"/obj/item/weapon/wrapping_paper",
"/obj/item/weapon/wrapping_paper")
cost = 20
containertype = "/obj/structure/closet/crate"
containername = "New Year Celebration crate"
*/
+218 -218
View File
@@ -1,218 +1,218 @@
/*
Base object for stackable items.
Stackable items are:
metal
rmetal
glass
rglass
wood planks
floor tiles
metal rods
*/
/obj/item/stack/New(var/loc, var/amount=null)
..()
if (amount)
src.amount=amount
return
/obj/item/stack/examine()
set src in view(1)
..()
usr << text("There are [] []\s left on the stack.", src.amount, src.singular_name)
return
/obj/item/stack/proc/use(var/amount)
src.amount-=amount
if (src.amount<=0)
var/oldsrc = src
src = null //dont kill proc after del()
usr.before_take_item(oldsrc)
del(oldsrc)
return
/obj/item/stack/proc/add_to_stacks(mob/usr as mob)
var/obj/item/stack/oldsrc = src
src = null
for (var/obj/item/stack/item in usr.loc)
if (item==oldsrc)
continue
if (!istype(item, oldsrc.type))
continue
if (item.amount>=item.max_amount)
continue
oldsrc.attackby(item, usr)
usr << "You add new [item.singular_name] to the stack. It now contains [item.amount] [item.singular_name]\s."
if(!oldsrc)
break
/obj/item/stack/attack_hand(mob/user as mob)
if (user.get_inactive_hand() == src)
var/obj/item/stack/F = new src.type( user, amount=1)
F.copy_evidences(src)
user.put_in_hand(F)
src.add_fingerprint(user)
F.add_fingerprint(user)
use(1)
if (src && usr.machine==src)
spawn(0) src.interact(usr)
else
..()
return
/obj/item/stack/attackby(obj/item/W as obj, mob/user as mob)
..()
if (istype(W, src.type))
var/obj/item/stack/S = W
if (S.amount >= max_amount)
return 1
var/to_transfer as num
if (user.get_inactive_hand()==src)
to_transfer = 1
else
to_transfer = min(src.amount, S.max_amount-S.amount)
S.amount+=to_transfer
if (S && usr.machine==S)
spawn(0) S.interact(usr)
src.use(to_transfer)
if (src && usr.machine==src)
spawn(0) src.interact(usr)
else return ..()
/obj/item/stack/proc/copy_evidences(obj/item/stack/from as obj)
src.blood_DNA = from.blood_DNA
src.blood_type = from.blood_type
src.fingerprints = from.fingerprints
src.fingerprintshidden = from.fingerprintshidden
src.fingerprintslast = from.fingerprintslast
//TODO bloody overlay
/datum/stack_recipe
var/title = "ERROR"
var/result_type
var/req_amount = 1
var/res_amount = 1
var/max_res_amount = 1
var/time = 0
var/one_per_turf = 0
var/on_floor = 0
New(title, result_type, req_amount = 1, res_amount = 1, max_res_amount = 1, time = 0, one_per_turf = 0, on_floor = 0)
src.title = title
src.result_type = result_type
src.req_amount = req_amount
src.res_amount = res_amount
src.max_res_amount = max_res_amount
src.time = time
src.one_per_turf = one_per_turf
src.on_floor = on_floor
/obj/item/stack
var/list/datum/stack_recipe/recipes
origin_tech = "materials=1"
/obj/item/stack/attack_self(mob/user as mob)
interact(user)
/obj/item/stack/proc/interact(mob/user as mob)
if (!recipes)
return
if (!src || amount<=0)
user << browse(null, "window=stack")
user.machine = src //for correct work of onclose
var/t1 = text("<HTML><HEAD><title>Constructions from []</title></HEAD><body><TT>Amount Left: []<br>", src, src.amount)
for(var/i=1;i<=recipes.len,i++)
var/datum/stack_recipe/R = recipes[i]
if (isnull(R))
t1 += "<hr>"
continue
if (i>1 && !isnull(recipes[i-1]))
t1+="<br>"
var/max_multiplier = round(src.amount / R.req_amount)
var/title as text
var/can_build = 1
can_build = can_build && (max_multiplier>0)
/*
if (R.one_per_turf)
can_build = can_build && !(locate(R.result_type) in usr.loc)
if (R.on_floor)
can_build = can_build && istype(usr.loc, /turf/simulated/floor)
*/
if (R.res_amount>1)
title+= "[R.res_amount]x [R.title]\s"
else
title+= "[R.title]"
title+= " ([R.req_amount] [src.singular_name]\s)"
if (can_build)
t1 += text("<A href='?src=\ref[];make=[]'>[]</A> ", src, i, title)
else
t1 += text("[]", title)
continue
if (R.max_res_amount>1 && max_multiplier>1)
max_multiplier = min(max_multiplier, round(R.max_res_amount/R.res_amount))
t1 += " |"
var/list/multipliers = list(5,10,25)
for (var/n in multipliers)
if (max_multiplier>=n)
t1 += " <A href='?src=\ref[src];make=[i];multiplier=[n]'>[n*R.res_amount]x</A>"
if (!(max_multiplier in multipliers))
t1 += " <A href='?src=\ref[src];make=[i];multiplier=[max_multiplier]'>[max_multiplier*R.res_amount]x</A>"
t1 += "</TT></body></HTML>"
user << browse(t1, "window=stack")
onclose(user, "stack")
return
/obj/item/stack/Topic(href, href_list)
..()
if ((usr.restrained() || usr.stat || usr.equipped() != src))
return
if (href_list["make"])
if (src.amount < 1) del(src) //Never should happen
var/datum/stack_recipe/R = recipes[text2num(href_list["make"])]
var/multiplier = text2num(href_list["multiplier"])
if (!multiplier) multiplier = 1
if (src.amount < R.req_amount*multiplier)
if (R.req_amount*multiplier>1)
usr << "\red You haven't got enough [src] to build \the [R.req_amount*multiplier] [R.title]\s!"
else
usr << "\red You haven't got enough [src] to build \the [R.title]!"
return
if (R.one_per_turf && (locate(R.result_type) in usr.loc))
usr << "\red There is another [R.title] here!"
return
if (R.on_floor && !istype(usr.loc, /turf/simulated/floor))
usr << "\red \The [R.title] must be constructed on the floor!"
return
if (R.time)
usr << "\blue Building [R.title] ..."
if (!do_after(usr, R.time))
return
if (src.amount < R.req_amount*multiplier)
return
var/atom/O = new R.result_type( usr.loc )
O.dir = usr.dir
if (R.max_res_amount>1)
var/obj/item/stack/new_item = O
new_item.amount = R.res_amount*multiplier
//new_item.add_to_stacks(usr)
src.amount-=R.req_amount*multiplier
if (src.amount<=0)
var/oldsrc = src
src = null //dont kill proc after del()
usr.before_take_item(oldsrc)
del(oldsrc)
if (istype(O,/obj/item))
usr.put_in_hand(O)
O.add_fingerprint(usr)
if (src && usr.machine==src) //do not reopen closed window
spawn( 0 )
src.interact(usr)
return
return
/obj/item/stack/Del()
if (src && usr && usr.machine==src)
usr << browse(null, "window=stack")
..()
/*
Base object for stackable items.
Stackable items are:
metal
rmetal
glass
rglass
wood planks
floor tiles
metal rods
*/
/obj/item/stack/New(var/loc, var/amount=null)
..()
if (amount)
src.amount=amount
return
/obj/item/stack/examine()
set src in view(1)
..()
usr << text("There are [] []\s left on the stack.", src.amount, src.singular_name)
return
/obj/item/stack/proc/use(var/amount)
src.amount-=amount
if (src.amount<=0)
var/oldsrc = src
src = null //dont kill proc after del()
usr.before_take_item(oldsrc)
del(oldsrc)
return
/obj/item/stack/proc/add_to_stacks(mob/usr as mob)
var/obj/item/stack/oldsrc = src
src = null
for (var/obj/item/stack/item in usr.loc)
if (item==oldsrc)
continue
if (!istype(item, oldsrc.type))
continue
if (item.amount>=item.max_amount)
continue
oldsrc.attackby(item, usr)
usr << "You add new [item.singular_name] to the stack. It now contains [item.amount] [item.singular_name]\s."
if(!oldsrc)
break
/obj/item/stack/attack_hand(mob/user as mob)
if (user.get_inactive_hand() == src)
var/obj/item/stack/F = new src.type( user, amount=1)
F.copy_evidences(src)
user.put_in_hand(F)
src.add_fingerprint(user)
F.add_fingerprint(user)
use(1)
if (src && usr.machine==src)
spawn(0) src.interact(usr)
else
..()
return
/obj/item/stack/attackby(obj/item/W as obj, mob/user as mob)
..()
if (istype(W, src.type))
var/obj/item/stack/S = W
if (S.amount >= max_amount)
return 1
var/to_transfer as num
if (user.get_inactive_hand()==src)
to_transfer = 1
else
to_transfer = min(src.amount, S.max_amount-S.amount)
S.amount+=to_transfer
if (S && usr.machine==S)
spawn(0) S.interact(usr)
src.use(to_transfer)
if (src && usr.machine==src)
spawn(0) src.interact(usr)
else return ..()
/obj/item/stack/proc/copy_evidences(obj/item/stack/from as obj)
src.blood_DNA = from.blood_DNA
src.blood_type = from.blood_type
src.fingerprints = from.fingerprints
src.fingerprintshidden = from.fingerprintshidden
src.fingerprintslast = from.fingerprintslast
//TODO bloody overlay
/datum/stack_recipe
var/title = "ERROR"
var/result_type
var/req_amount = 1
var/res_amount = 1
var/max_res_amount = 1
var/time = 0
var/one_per_turf = 0
var/on_floor = 0
New(title, result_type, req_amount = 1, res_amount = 1, max_res_amount = 1, time = 0, one_per_turf = 0, on_floor = 0)
src.title = title
src.result_type = result_type
src.req_amount = req_amount
src.res_amount = res_amount
src.max_res_amount = max_res_amount
src.time = time
src.one_per_turf = one_per_turf
src.on_floor = on_floor
/obj/item/stack
var/list/datum/stack_recipe/recipes
origin_tech = "materials=1"
/obj/item/stack/attack_self(mob/user as mob)
interact(user)
/obj/item/stack/proc/interact(mob/user as mob)
if (!recipes)
return
if (!src || amount<=0)
user << browse(null, "window=stack")
user.machine = src //for correct work of onclose
var/t1 = text("<HTML><HEAD><title>Constructions from []</title></HEAD><body><TT>Amount Left: []<br>", src, src.amount)
for(var/i=1;i<=recipes.len,i++)
var/datum/stack_recipe/R = recipes[i]
if (isnull(R))
t1 += "<hr>"
continue
if (i>1 && !isnull(recipes[i-1]))
t1+="<br>"
var/max_multiplier = round(src.amount / R.req_amount)
var/title as text
var/can_build = 1
can_build = can_build && (max_multiplier>0)
/*
if (R.one_per_turf)
can_build = can_build && !(locate(R.result_type) in usr.loc)
if (R.on_floor)
can_build = can_build && istype(usr.loc, /turf/simulated/floor)
*/
if (R.res_amount>1)
title+= "[R.res_amount]x [R.title]\s"
else
title+= "[R.title]"
title+= " ([R.req_amount] [src.singular_name]\s)"
if (can_build)
t1 += text("<A href='?src=\ref[];make=[]'>[]</A> ", src, i, title)
else
t1 += text("[]", title)
continue
if (R.max_res_amount>1 && max_multiplier>1)
max_multiplier = min(max_multiplier, round(R.max_res_amount/R.res_amount))
t1 += " |"
var/list/multipliers = list(5,10,25)
for (var/n in multipliers)
if (max_multiplier>=n)
t1 += " <A href='?src=\ref[src];make=[i];multiplier=[n]'>[n*R.res_amount]x</A>"
if (!(max_multiplier in multipliers))
t1 += " <A href='?src=\ref[src];make=[i];multiplier=[max_multiplier]'>[max_multiplier*R.res_amount]x</A>"
t1 += "</TT></body></HTML>"
user << browse(t1, "window=stack")
onclose(user, "stack")
return
/obj/item/stack/Topic(href, href_list)
..()
if ((usr.restrained() || usr.stat || usr.equipped() != src))
return
if (href_list["make"])
if (src.amount < 1) del(src) //Never should happen
var/datum/stack_recipe/R = recipes[text2num(href_list["make"])]
var/multiplier = text2num(href_list["multiplier"])
if (!multiplier) multiplier = 1
if (src.amount < R.req_amount*multiplier)
if (R.req_amount*multiplier>1)
usr << "\red You haven't got enough [src] to build \the [R.req_amount*multiplier] [R.title]\s!"
else
usr << "\red You haven't got enough [src] to build \the [R.title]!"
return
if (R.one_per_turf && (locate(R.result_type) in usr.loc))
usr << "\red There is another [R.title] here!"
return
if (R.on_floor && !istype(usr.loc, /turf/simulated/floor))
usr << "\red \The [R.title] must be constructed on the floor!"
return
if (R.time)
usr << "\blue Building [R.title] ..."
if (!do_after(usr, R.time))
return
if (src.amount < R.req_amount*multiplier)
return
var/atom/O = new R.result_type( usr.loc )
O.dir = usr.dir
if (R.max_res_amount>1)
var/obj/item/stack/new_item = O
new_item.amount = R.res_amount*multiplier
//new_item.add_to_stacks(usr)
src.amount-=R.req_amount*multiplier
if (src.amount<=0)
var/oldsrc = src
src = null //dont kill proc after del()
usr.before_take_item(oldsrc)
del(oldsrc)
if (istype(O,/obj/item))
usr.put_in_hand(O)
O.add_fingerprint(usr)
if (src && usr.machine==src) //do not reopen closed window
spawn( 0 )
src.interact(usr)
return
return
/obj/item/stack/Del()
if (src && usr && usr.machine==src)
usr << browse(null, "window=stack")
..()
+218 -218
View File
@@ -1,219 +1,219 @@
//Banhammer deserves to be the first thing here
/obj/item/weapon/banhammer/attack(mob/M as mob, mob/user as mob)
M << "<font color='red'><b> You have been banned FOR NO REISIN by [user]<b></font>"
user << "<font color='red'> You have <b>BANNED</b> [M]</font>"
/obj/effect/mine/proc/triggerrad(obj)
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(3, 1, src)
s.start()
obj:radiation += 50
randmutb(obj)
domutcheck(obj,null)
spawn(0)
del(src)
/obj/effect/mine/proc/triggerstun(obj)
if(ismob(obj))
var/mob/M = obj
M.Stun(30)
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(3, 1, src)
s.start()
spawn(0)
del(src)
/obj/effect/mine/proc/triggern2o(obj)
//example: n2o triggerproc
//note: im lazy
for (var/turf/simulated/floor/target in range(1,src))
if(!target.blocks_air)
if(target.parent)
target.parent.suspend_group_processing()
var/datum/gas_mixture/payload = new
var/datum/gas/sleeping_agent/trace_gas = new
trace_gas.moles = 30
payload += trace_gas
target.air.merge(payload)
spawn(0)
del(src)
/obj/effect/mine/proc/triggerplasma(obj)
for (var/turf/simulated/floor/target in range(1,src))
if(!target.blocks_air)
if(target.parent)
target.parent.suspend_group_processing()
var/datum/gas_mixture/payload = new
payload.toxins = 30
target.air.merge(payload)
target.hotspot_expose(1000, CELL_VOLUME)
spawn(0)
del(src)
/obj/effect/mine/proc/triggerkick(obj)
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(3, 1, src)
s.start()
del(obj:client)
spawn(0)
del(src)
/obj/effect/mine/proc/explode(obj)
explosion(loc, 0, 1, 2, 3)
spawn(0)
del(src)
/obj/effect/mine/HasEntered(AM as mob|obj)
Bumped(AM)
/obj/effect/mine/Bumped(mob/M as mob|obj)
if(triggered) return
if(istype(M, /mob/living/carbon/human) || istype(M, /mob/living/carbon/monkey))
for(var/mob/O in viewers(world.view, src.loc))
O << text("<font color='red'>[M] triggered the \icon[] [src]</font>", src)
triggered = 1
call(src,triggerproc)(M)
/obj/effect/mine/New()
icon_state = "uglyminearmed"
/atom/proc/ex_act()
return
/atom/proc/blob_act()
return
// bullet_act called when anything is hit buy a projectile (bullet, tazer shot, laser, etc.)
// flag is projectile type, can be:
//PROJECTILE_TASER = 1 taser gun
//PROJECTILE_LASER = 2 laser gun
//PROJECTILE_BULLET = 3 traitor pistol
//PROJECTILE_PULSE = 4 pulse rifle
//PROJECTILE_BOLT = 5 crossbow
//PROJECTILE_WEAKBULLET = 6 detective's revolver
/turf/Entered(atom/A as mob|obj)
..()
if ((A && A.density && !( istype(A, /obj/effect/beam) )))
for(var/obj/effect/beam/i_beam/I in src)
spawn( 0 )
if (I)
I.hit()
return
return
/obj/item/weapon/mousetrap/examine()
set src in oview(12)
..()
if(armed)
usr << "\red It looks like it's armed."
/obj/item/weapon/mousetrap/proc/triggered(mob/target as mob, var/type = "feet")
if(!armed)
return
var/datum/organ/external/affecting = null
if(ishuman(target))
var/mob/living/carbon/human/H = target
switch(type)
if("feet")
if(!H.shoes)
affecting = H.get_organ(pick("l_leg", "r_leg"))
H.Weaken(3)
if("l_hand", "r_hand")
if(!H.gloves)
affecting = H.get_organ(type)
H.Stun(3)
if(affecting)
affecting.take_damage(1, 0)
H.UpdateDamageIcon()
H.updatehealth()
playsound(target.loc, 'snap.ogg', 50, 1)
icon_state = "mousetrap"
armed = 0
/*
else if (ismouse(target))
target.adjustBruteLoss(100)
*/
/obj/item/weapon/mousetrap/attack_self(mob/user as mob)
if(!armed)
icon_state = "mousetraparmed"
user << "\blue You arm the mousetrap."
else
icon_state = "mousetrap"
if((user.getBrainLoss() >= 60 || user.mutations & CLUMSY) && prob(50))
var/which_hand = "l_hand"
if(!user.hand)
which_hand = "r_hand"
src.triggered(user, which_hand)
user << "\red <B>You accidentally trigger the mousetrap!</B>"
for(var/mob/O in viewers(user, null))
if(O == user)
continue
O.show_message(text("\red <B>[user] accidentally sets off the mousetrap, breaking their fingers.</B>"), 1)
return
user << "\blue You disarm the mousetrap."
armed = !armed
playsound(user.loc, 'handcuffs.ogg', 30, 1, -3)
/obj/item/weapon/mousetrap/attack_hand(mob/user as mob)
if(armed)
if((user.getBrainLoss() >= 60 || user.mutations & CLUMSY) && prob(50))
var/which_hand = "l_hand"
if(!user.hand)
which_hand = "r_hand"
src.triggered(user, which_hand)
user << "\red <B>You accidentally trigger the mousetrap!</B>"
for(var/mob/O in viewers(user, null))
if(O == user)
continue
O.show_message(text("\red <B>[user] accidentally sets off the mousetrap, breaking their fingers.</B>"), 1)
return
..()
/obj/item/weapon/mousetrap/HasEntered(AM as mob|obj)
if((ishuman(AM)) && (armed))
var/mob/living/carbon/H = AM
if(H.m_intent == "run")
src.triggered(H)
H << "\red <B>You accidentally step on the mousetrap!</B>"
for(var/mob/O in viewers(H, null))
if(O == H)
continue
O.show_message(text("\red <B>[H] accidentally steps on the mousetrap.</B>"), 1)
..()
/obj/item/weapon/mousetrap/hitby(A as mob|obj)
if(!armed)
return ..()
for(var/mob/O in viewers(src, null))
O.show_message(text("\red <B>The mousetrap is triggered by [A].</B>"), 1)
src.triggered(null)
/obj/item/weapon/fireaxe/afterattack(atom/A as mob|obj|turf|area, mob/user as mob)
..()
if(A && wielded && (istype(A,/obj/structure/window) || istype(A,/obj/structure/grille))) //destroys windows and grilles in one hit
if(istype(A,/obj/structure/window)) //should just make a window.Break() proc but couldn't bother with it
var/obj/structure/window/W = A
new /obj/item/weapon/shard( W.loc )
if(W.reinf) new /obj/item/stack/rods( W.loc)
if (W.dir == SOUTHWEST)
new /obj/item/weapon/shard( W.loc )
if(W.reinf) new /obj/item/stack/rods( W.loc)
//Banhammer deserves to be the first thing here
/obj/item/weapon/banhammer/attack(mob/M as mob, mob/user as mob)
M << "<font color='red'><b> You have been banned FOR NO REISIN by [user]<b></font>"
user << "<font color='red'> You have <b>BANNED</b> [M]</font>"
/obj/effect/mine/proc/triggerrad(obj)
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(3, 1, src)
s.start()
obj:radiation += 50
randmutb(obj)
domutcheck(obj,null)
spawn(0)
del(src)
/obj/effect/mine/proc/triggerstun(obj)
if(ismob(obj))
var/mob/M = obj
M.Stun(30)
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(3, 1, src)
s.start()
spawn(0)
del(src)
/obj/effect/mine/proc/triggern2o(obj)
//example: n2o triggerproc
//note: im lazy
for (var/turf/simulated/floor/target in range(1,src))
if(!target.blocks_air)
if(target.parent)
target.parent.suspend_group_processing()
var/datum/gas_mixture/payload = new
var/datum/gas/sleeping_agent/trace_gas = new
trace_gas.moles = 30
payload += trace_gas
target.air.merge(payload)
spawn(0)
del(src)
/obj/effect/mine/proc/triggerplasma(obj)
for (var/turf/simulated/floor/target in range(1,src))
if(!target.blocks_air)
if(target.parent)
target.parent.suspend_group_processing()
var/datum/gas_mixture/payload = new
payload.toxins = 30
target.air.merge(payload)
target.hotspot_expose(1000, CELL_VOLUME)
spawn(0)
del(src)
/obj/effect/mine/proc/triggerkick(obj)
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(3, 1, src)
s.start()
del(obj:client)
spawn(0)
del(src)
/obj/effect/mine/proc/explode(obj)
explosion(loc, 0, 1, 2, 3)
spawn(0)
del(src)
/obj/effect/mine/HasEntered(AM as mob|obj)
Bumped(AM)
/obj/effect/mine/Bumped(mob/M as mob|obj)
if(triggered) return
if(istype(M, /mob/living/carbon/human) || istype(M, /mob/living/carbon/monkey))
for(var/mob/O in viewers(world.view, src.loc))
O << text("<font color='red'>[M] triggered the \icon[] [src]</font>", src)
triggered = 1
call(src,triggerproc)(M)
/obj/effect/mine/New()
icon_state = "uglyminearmed"
/atom/proc/ex_act()
return
/atom/proc/blob_act()
return
// bullet_act called when anything is hit buy a projectile (bullet, tazer shot, laser, etc.)
// flag is projectile type, can be:
//PROJECTILE_TASER = 1 taser gun
//PROJECTILE_LASER = 2 laser gun
//PROJECTILE_BULLET = 3 traitor pistol
//PROJECTILE_PULSE = 4 pulse rifle
//PROJECTILE_BOLT = 5 crossbow
//PROJECTILE_WEAKBULLET = 6 detective's revolver
/turf/Entered(atom/A as mob|obj)
..()
if ((A && A.density && !( istype(A, /obj/effect/beam) )))
for(var/obj/effect/beam/i_beam/I in src)
spawn( 0 )
if (I)
I.hit()
return
return
/obj/item/weapon/mousetrap/examine()
set src in oview(12)
..()
if(armed)
usr << "\red It looks like it's armed."
/obj/item/weapon/mousetrap/proc/triggered(mob/target as mob, var/type = "feet")
if(!armed)
return
var/datum/organ/external/affecting = null
if(ishuman(target))
var/mob/living/carbon/human/H = target
switch(type)
if("feet")
if(!H.shoes)
affecting = H.get_organ(pick("l_leg", "r_leg"))
H.Weaken(3)
if("l_hand", "r_hand")
if(!H.gloves)
affecting = H.get_organ(type)
H.Stun(3)
if(affecting)
affecting.take_damage(1, 0)
H.UpdateDamageIcon()
H.updatehealth()
playsound(target.loc, 'snap.ogg', 50, 1)
icon_state = "mousetrap"
armed = 0
/*
else if (ismouse(target))
target.adjustBruteLoss(100)
*/
/obj/item/weapon/mousetrap/attack_self(mob/user as mob)
if(!armed)
icon_state = "mousetraparmed"
user << "\blue You arm the mousetrap."
else
icon_state = "mousetrap"
if((user.getBrainLoss() >= 60 || user.mutations & CLUMSY) && prob(50))
var/which_hand = "l_hand"
if(!user.hand)
which_hand = "r_hand"
src.triggered(user, which_hand)
user << "\red <B>You accidentally trigger the mousetrap!</B>"
for(var/mob/O in viewers(user, null))
if(O == user)
continue
O.show_message(text("\red <B>[user] accidentally sets off the mousetrap, breaking their fingers.</B>"), 1)
return
user << "\blue You disarm the mousetrap."
armed = !armed
playsound(user.loc, 'handcuffs.ogg', 30, 1, -3)
/obj/item/weapon/mousetrap/attack_hand(mob/user as mob)
if(armed)
if((user.getBrainLoss() >= 60 || user.mutations & CLUMSY) && prob(50))
var/which_hand = "l_hand"
if(!user.hand)
which_hand = "r_hand"
src.triggered(user, which_hand)
user << "\red <B>You accidentally trigger the mousetrap!</B>"
for(var/mob/O in viewers(user, null))
if(O == user)
continue
O.show_message(text("\red <B>[user] accidentally sets off the mousetrap, breaking their fingers.</B>"), 1)
return
..()
/obj/item/weapon/mousetrap/HasEntered(AM as mob|obj)
if((ishuman(AM)) && (armed))
var/mob/living/carbon/H = AM
if(H.m_intent == "run")
src.triggered(H)
H << "\red <B>You accidentally step on the mousetrap!</B>"
for(var/mob/O in viewers(H, null))
if(O == H)
continue
O.show_message(text("\red <B>[H] accidentally steps on the mousetrap.</B>"), 1)
..()
/obj/item/weapon/mousetrap/hitby(A as mob|obj)
if(!armed)
return ..()
for(var/mob/O in viewers(src, null))
O.show_message(text("\red <B>The mousetrap is triggered by [A].</B>"), 1)
src.triggered(null)
/obj/item/weapon/fireaxe/afterattack(atom/A as mob|obj|turf|area, mob/user as mob)
..()
if(A && wielded && (istype(A,/obj/structure/window) || istype(A,/obj/structure/grille))) //destroys windows and grilles in one hit
if(istype(A,/obj/structure/window)) //should just make a window.Break() proc but couldn't bother with it
var/obj/structure/window/W = A
new /obj/item/weapon/shard( W.loc )
if(W.reinf) new /obj/item/stack/rods( W.loc)
if (W.dir == SOUTHWEST)
new /obj/item/weapon/shard( W.loc )
if(W.reinf) new /obj/item/stack/rods( W.loc)
del(A)