mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-31 07:57:47 +01:00
Merge branch 'master' of https://github.com/ParadiseSS13/Paradise into CultistRave
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
|
||||
/timed_alert/proc/timed_alert(client/ref_client, question, title, time, choice1, choice2, choice3)
|
||||
if (!ref_client) return
|
||||
spawn (time) del src // When src is deleted, the proc ends immediately. The alert itself closes.
|
||||
spawn (time) del(src) // When src is deleted, the proc ends immediately. The alert itself closes.
|
||||
|
||||
var/ref_answer
|
||||
ref_answer = alert(ref_client, question, title, choice1, choice2, choice3)
|
||||
|
||||
@@ -12,7 +12,7 @@ var/list/liftable_structures = list(\
|
||||
/obj/machinery/optable, \
|
||||
/obj/structure/dispenser, \
|
||||
/obj/machinery/gibber, \
|
||||
/obj/machinery/microwave, \
|
||||
/obj/machinery/kitchen_machine/microwave, \
|
||||
/obj/machinery/vending, \
|
||||
/obj/machinery/seed_extractor, \
|
||||
/obj/machinery/space_heater, \
|
||||
|
||||
@@ -100,6 +100,9 @@
|
||||
var/revival_cloning = 1
|
||||
var/revival_brain_life = -1
|
||||
|
||||
|
||||
var/auto_toggle_ooc_during_round = 0
|
||||
|
||||
//Used for modifying movement speed for mobs.
|
||||
//Unversal modifiers
|
||||
var/run_speed = 0
|
||||
@@ -534,6 +537,8 @@
|
||||
config.revival_cloning = value
|
||||
if("revival_brain_life")
|
||||
config.revival_brain_life = value
|
||||
if("auto_toggle_ooc_during_round")
|
||||
config.auto_toggle_ooc_during_round = 1
|
||||
if("run_speed")
|
||||
config.run_speed = value
|
||||
if("walk_speed")
|
||||
|
||||
@@ -49,7 +49,7 @@ datum/controller/game_controller/New()
|
||||
if(master_controller != src)
|
||||
if(istype(master_controller))
|
||||
Recover()
|
||||
qdel(master_controller)
|
||||
del(master_controller)
|
||||
master_controller = src
|
||||
|
||||
if(!job_master)
|
||||
|
||||
@@ -316,7 +316,7 @@ proc/get_id_photo(var/mob/living/carbon/human/H)
|
||||
preview_icon.Blend(eyes_s, ICON_OVERLAY)
|
||||
if(clothes_s)
|
||||
preview_icon.Blend(clothes_s, ICON_OVERLAY)
|
||||
del(eyes_s)
|
||||
del(clothes_s)
|
||||
qdel(eyes_s)
|
||||
qdel(clothes_s)
|
||||
|
||||
return preview_icon
|
||||
|
||||
+3
-3
@@ -825,7 +825,7 @@ datum/mind
|
||||
ticker.mode.changelings -= src
|
||||
special_role = null
|
||||
current.remove_changeling_powers()
|
||||
if(changeling) del(changeling)
|
||||
if(changeling) qdel(changeling)
|
||||
current << "<FONT color='red' size = 3><B>You grow weak and lose your powers! You are no longer a changeling and are stuck in your current form!</B></FONT>"
|
||||
log_admin("[key_name_admin(usr)] has de-changeling'ed [current].")
|
||||
if("changeling")
|
||||
@@ -855,7 +855,7 @@ datum/mind
|
||||
ticker.mode.vampires -= src
|
||||
special_role = null
|
||||
current.remove_vampire_powers()
|
||||
if(vampire) del(vampire)
|
||||
if(vampire) qdel(vampire)
|
||||
current << "<FONT color='red' size = 3><B>You grow weak and lose your powers! You are no longer a vampire and are stuck in your current form!</B></FONT>"
|
||||
log_admin("[key_name_admin(usr)] has de-vampired [current].")
|
||||
if("vampire")
|
||||
@@ -1021,7 +1021,7 @@ datum/mind
|
||||
A.malf_picker.remove_verbs(A)
|
||||
|
||||
A.make_laws()
|
||||
del(A.malf_picker)
|
||||
qdel(A.malf_picker)
|
||||
A.show_laws()
|
||||
A.icon_state = "ai"
|
||||
|
||||
|
||||
@@ -142,3 +142,12 @@
|
||||
return byproduct
|
||||
else
|
||||
return null
|
||||
|
||||
/datum/recipe/proc/count_n_items()
|
||||
var/count = 0
|
||||
if(items && items.len)
|
||||
count += items.len
|
||||
if(fruit && fruit.len)
|
||||
for(var/ktag in fruit)
|
||||
count += fruit[ktag]
|
||||
return count
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
M.perform_infestation(first_host.current)
|
||||
forge_borer_objectives(borer, first_host)
|
||||
|
||||
del original
|
||||
del(original)
|
||||
|
||||
log_admin("Created [borers.len] borers.")
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ var/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","Epsilon"
|
||||
config_tag = "changeling"
|
||||
restricted_jobs = list("AI", "Cyborg")
|
||||
protected_jobs = list("Security Officer", "Warden", "Detective", "Head of Security", "Captain", "Blueshield", "Nanotrasen Representative", "Security Pod Pilot", "Magistrate", "Brig Physician", "Internal Affairs Agent")
|
||||
protected_species = list("Machine", "Slime People")
|
||||
protected_species = list("Machine", "Slime People", "Plasmaman")
|
||||
required_players = 2
|
||||
required_players_secret = 10
|
||||
required_enemies = 1
|
||||
@@ -304,6 +304,10 @@ var/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","Epsilon"
|
||||
user << "<span class='warning'>We do not know how to parse this creature's DNA!</span>"
|
||||
return
|
||||
|
||||
if(T.species.flags & NO_BLOOD)
|
||||
user << "<span class='warning'>We are not able to use the DNA of a creature without a circulatory system.</span>"
|
||||
return
|
||||
|
||||
if(has_dna(target.dna))
|
||||
user << "<span class='warning'>We already have this DNA in storage!</span>"
|
||||
|
||||
|
||||
@@ -62,10 +62,11 @@
|
||||
/obj/effect/proc_holder/changeling/sting/transformation
|
||||
name = "Transformation Sting"
|
||||
desc = "We silently sting a human, injecting a retrovirus that forces them to transform."
|
||||
helptext = "Does not provide a warning to others. The victim will transform much like a changeling would."
|
||||
helptext = "The victim will transform much like a changeling would. The effects will be obvious to the victim, and the process will damage our genomes."
|
||||
sting_icon = "sting_transform"
|
||||
chemical_cost = 40
|
||||
dna_cost = 2
|
||||
genetic_damage = 100
|
||||
var/datum/dna/selected_dna = null
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/transformation/Click()
|
||||
@@ -77,12 +78,11 @@
|
||||
selected_dna = changeling.select_dna("Select the target DNA: ", "Target DNA")
|
||||
if(!selected_dna)
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/transformation/can_sting(var/mob/user, var/mob/target)
|
||||
if(!..())
|
||||
return
|
||||
if((HUSK in target.mutations) || (!ishuman(target)) )
|
||||
if((HUSK in target.mutations) || (!ishuman(target)))
|
||||
user << "<span class='warning'>Our sting appears ineffective against its DNA.</span>"
|
||||
return 0
|
||||
if(ishuman(target))
|
||||
@@ -90,20 +90,31 @@
|
||||
if(H.species.flags & NO_SCAN) //Prevents transforming slimes and killing them instantly
|
||||
user << "<span class='warning'>This won't work on a creature with abnormal genetic material.</span>"
|
||||
return 0
|
||||
if(H.species.flags & NO_BLOOD)
|
||||
user << "<span class='warning'>This won't work on a creature without a circulatory system.</span>"
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/obj/effect/proc_holder/changeling/sting/transformation/sting_action(var/mob/user, var/mob/target)
|
||||
add_logs(target, user, "stung", object="transformation sting", addition=" new identity is [selected_dna.real_name]")
|
||||
var/datum/dna/NewDNA = selected_dna
|
||||
if(issmall(target))
|
||||
user << "<span class='notice'>We stealthily sting [target.name].</span>"
|
||||
target.dna = NewDNA.Clone()
|
||||
target.real_name = NewDNA.real_name
|
||||
var/mob/living/carbon/human/H = target
|
||||
if(istype(H))
|
||||
H.set_species()
|
||||
target.UpdateAppearance()
|
||||
domutcheck(target, null)
|
||||
user << "<span class='notice'>Our genes cry out as we sting [target.name]!</span>"
|
||||
|
||||
if(iscarbon(target) && (target.status_flags & CANWEAKEN))
|
||||
var/mob/living/carbon/C = target
|
||||
C.do_jitter_animation(500)
|
||||
|
||||
target.visible_message("<span class='danger'>[target] begins to violenty convulse!</span>","<span class='userdanger'>You feel a tiny prick and a begin to uncontrollably convulse!</span>")
|
||||
|
||||
spawn(10)
|
||||
target.dna = NewDNA.Clone()
|
||||
target.real_name = NewDNA.real_name
|
||||
var/mob/living/carbon/human/H = target
|
||||
if(istype(H))
|
||||
H.set_species()
|
||||
target.UpdateAppearance()
|
||||
domutcheck(target, null)
|
||||
feedback_add_details("changeling_powers","TS")
|
||||
return 1
|
||||
|
||||
@@ -172,7 +183,7 @@ obj/effect/proc_holder/changeling/sting/LSD
|
||||
target.hallucination = max(400, target.hallucination)
|
||||
feedback_add_details("changeling_powers","HS")
|
||||
return 1
|
||||
/*
|
||||
|
||||
obj/effect/proc_holder/changeling/sting/cryo //Enable when mob cooling is fixed so that frostoil actually makes you cold, instead of mostly just hungry.
|
||||
name = "Cryogenic Sting"
|
||||
desc = "We silently sting a human with a cocktail of chemicals that freeze them."
|
||||
@@ -188,4 +199,4 @@ obj/effect/proc_holder/changeling/sting/cryo //Enable when mob cooling is fixed
|
||||
target.reagents.add_reagent("ice", 30)
|
||||
feedback_add_details("changeling_powers","CS")
|
||||
return 1
|
||||
*/
|
||||
|
||||
|
||||
@@ -219,6 +219,7 @@ var/global/datum/controller/gameticker/ticker
|
||||
admins_number++
|
||||
if(admins_number == 0)
|
||||
send2adminirc("Round has started with no admins online.")
|
||||
auto_toggle_ooc(0) // Turn it off
|
||||
|
||||
/* DONE THROUGH PROCESS SCHEDULER
|
||||
supply_controller.process() //Start the supply shuttle regenerating points -- TLE
|
||||
@@ -250,6 +251,7 @@ var/global/datum/controller/gameticker/ticker
|
||||
proc/station_explosion_cinematic(var/station_missed=0, var/override = null)
|
||||
if( cinematic ) return //already a cinematic in progress!
|
||||
|
||||
auto_toggle_ooc(1) // Turn it on
|
||||
//initialise our cinematic screen object
|
||||
cinematic = new(src)
|
||||
cinematic.icon = 'icons/effects/station_explosion.dmi'
|
||||
@@ -355,7 +357,7 @@ var/global/datum/controller/gameticker/ticker
|
||||
continue
|
||||
else
|
||||
player.create_character()
|
||||
del(player)
|
||||
qdel(player)
|
||||
|
||||
|
||||
proc/collect_minds()
|
||||
@@ -400,7 +402,7 @@ var/global/datum/controller/gameticker/ticker
|
||||
|
||||
if(!mode.explosion_in_progress && game_finished && (mode_finished || post_game))
|
||||
current_state = GAME_STATE_FINISHED
|
||||
|
||||
auto_toggle_ooc(1) // Turn it on
|
||||
spawn
|
||||
declare_completion()
|
||||
|
||||
|
||||
@@ -219,7 +219,7 @@
|
||||
if (href_list["del_all2"])
|
||||
for(var/datum/data/record/R in data_core.medical)
|
||||
//R = null
|
||||
del(R)
|
||||
qdel(R)
|
||||
//Foreach goto(494)
|
||||
src.temp = "All records deleted."
|
||||
|
||||
|
||||
@@ -274,7 +274,7 @@ to destroy them and players will be able to make replacements.
|
||||
|
||||
/obj/item/weapon/circuitboard/microwave
|
||||
name = "circuit board (Microwave)"
|
||||
build_path = /obj/machinery/microwave
|
||||
build_path = /obj/machinery/kitchen_machine/microwave
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=1"
|
||||
frame_desc = "Requires 1 Micro Laser, 2 pieces of cable and 1 Console Screen."
|
||||
@@ -285,7 +285,7 @@ to destroy them and players will be able to make replacements.
|
||||
|
||||
/obj/item/weapon/circuitboard/oven
|
||||
name = "circuit board (Oven)"
|
||||
build_path = /obj/machinery/oven
|
||||
build_path = /obj/machinery/kitchen_machine/oven
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=1;plasmatech=1"
|
||||
frame_desc = "Requires 2 Micro Lasers, 5 pieces of cable and 1 Console Screen."
|
||||
@@ -296,7 +296,7 @@ to destroy them and players will be able to make replacements.
|
||||
|
||||
/obj/item/weapon/circuitboard/grill
|
||||
name = "circuit board (Grill)"
|
||||
build_path = /obj/machinery/grill
|
||||
build_path = /obj/machinery/kitchen_machine/grill
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=1;plasmatech=1"
|
||||
frame_desc = "Requires 2 Micro Lasers, 5 pieces of cable and 1 Console Screen."
|
||||
@@ -307,7 +307,7 @@ to destroy them and players will be able to make replacements.
|
||||
|
||||
/obj/item/weapon/circuitboard/candy_maker
|
||||
name = "circuit board (Candy Maker)"
|
||||
build_path = /obj/machinery/candy_maker
|
||||
build_path = /obj/machinery/kitchen_machine/candy_maker
|
||||
board_type = "machine"
|
||||
origin_tech = "programming=2"
|
||||
frame_desc = "Requires 1 Manipulator, 5 pieces of cable and 1 Console Screen."
|
||||
|
||||
@@ -0,0 +1,403 @@
|
||||
|
||||
/obj/machinery/kitchen_machine
|
||||
name = "Base Kitchen Machine"
|
||||
desc = "If you are seeing this, a coder/mapper messed up. Please report it."
|
||||
layer = 2.9
|
||||
density = 1
|
||||
anchored = 1
|
||||
use_power = 1
|
||||
idle_power_usage = 5
|
||||
active_power_usage = 100
|
||||
flags = OPENCONTAINER | NOREACT
|
||||
var/operating = 0 // Is it on?
|
||||
var/dirty = 0 // = {0..100} Does it need cleaning?
|
||||
var/broken = 0 // ={0,1,2} How broken is it???
|
||||
var/efficiency = 0
|
||||
var/list/cook_verbs = list("Cooking")
|
||||
//Recipe & Item vars
|
||||
var/recipe_type //Make sure to set this on the machine definition, or else you're gonna runtime on New()
|
||||
var/list/datum/recipe/available_recipes // List of the recipes you can use
|
||||
var/list/acceptable_items // List of the items you can put in
|
||||
var/list/acceptable_reagents // List of the reagents you can put in
|
||||
var/max_n_of_items = 0
|
||||
//Icon states
|
||||
var/off_icon
|
||||
var/on_icon
|
||||
var/broken_icon
|
||||
var/dirty_icon
|
||||
var/open_icon
|
||||
|
||||
/*******************
|
||||
* Initialising
|
||||
********************/
|
||||
|
||||
/obj/machinery/kitchen_machine/New()
|
||||
reagents = new/datum/reagents(100)
|
||||
reagents.my_atom = src
|
||||
if (!available_recipes)
|
||||
available_recipes = new
|
||||
acceptable_items = new
|
||||
acceptable_reagents = new
|
||||
for (var/type in (typesof(recipe_type)-recipe_type))
|
||||
var/datum/recipe/recipe = new type
|
||||
if(recipe.result) // Ignore recipe subtypes that lack a result
|
||||
available_recipes += recipe
|
||||
for (var/item in recipe.items)
|
||||
acceptable_items |= item
|
||||
for (var/reagent in recipe.reagents)
|
||||
acceptable_reagents |= reagent
|
||||
if (recipe.items || recipe.fruit)
|
||||
max_n_of_items = max(max_n_of_items,recipe.count_n_items())
|
||||
else
|
||||
qdel(recipe)
|
||||
acceptable_items |= /obj/item/weapon/reagent_containers/food/snacks/grown
|
||||
|
||||
/*******************
|
||||
* Item Adding
|
||||
********************/
|
||||
|
||||
/obj/machinery/kitchen_machine/attackby(var/obj/item/O as obj, var/mob/user as mob, params)
|
||||
if(operating)
|
||||
return
|
||||
if(!broken && dirty < 100)
|
||||
if(default_deconstruction_screwdriver(user, open_icon, off_icon, O))
|
||||
return
|
||||
if(exchange_parts(user, O))
|
||||
return
|
||||
if(!broken && istype(O, /obj/item/weapon/wrench))
|
||||
playsound(src, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
if(anchored)
|
||||
anchored = 0
|
||||
user << "<span class='alert'>\The [src] can now be moved.</span>"
|
||||
return
|
||||
else if(!anchored)
|
||||
anchored = 1
|
||||
user << "<span class='alert'>\The [src] is now secured.</span>"
|
||||
return
|
||||
|
||||
default_deconstruction_crowbar(O)
|
||||
|
||||
if(src.broken > 0)
|
||||
if(src.broken == 2 && istype(O, /obj/item/weapon/screwdriver)) // If it's broken and they're using a screwdriver
|
||||
user.visible_message( \
|
||||
"<span class='notice'>[user] starts to fix part of \the [src].</span>", \
|
||||
"<span class='notice'>You start to fix part of \the [src].</span>" \
|
||||
)
|
||||
if (do_after(user,20))
|
||||
user.visible_message( \
|
||||
"<span class='notice'>[user] fixes part of \the [src].</span>", \
|
||||
"<span class='notice'>You have fixed part of \the [src].</span>" \
|
||||
)
|
||||
src.broken = 1 // Fix it a bit
|
||||
else if(src.broken == 1 && istype(O, /obj/item/weapon/wrench)) // If it's broken and they're doing the wrench
|
||||
user.visible_message( \
|
||||
"<span class='notice'>[user] starts to fix part of \the [src].</span>", \
|
||||
"<span class='notice'>You start to fix part of \the [src].</span>" \
|
||||
)
|
||||
if (do_after(user,20))
|
||||
user.visible_message( \
|
||||
"<span class='notice'>[user] fixes \the [src].</span>", \
|
||||
"<span class='notice'>You have fixed \the [src].</span>" \
|
||||
)
|
||||
src.icon_state = off_icon
|
||||
src.broken = 0 // Fix it!
|
||||
src.dirty = 0 // just to be sure
|
||||
src.flags = OPENCONTAINER
|
||||
else
|
||||
user << "<span class='alert'>It's broken!</span>"
|
||||
return 1
|
||||
else if(src.dirty==100) // The machine is all dirty so can't be used!
|
||||
if(istype(O, /obj/item/weapon/reagent_containers/spray/cleaner) || istype(O, /obj/item/weapon/soap)) // If they're trying to clean it then let them
|
||||
user.visible_message( \
|
||||
"<span class='notice'>[user] starts to clean \the [src].</span>", \
|
||||
"<span class='notice'>You start to clean \the [src].</span>" \
|
||||
)
|
||||
if (do_after(user,20))
|
||||
user.visible_message( \
|
||||
"<span class='notice'>[user] has cleaned \the [src].</span>", \
|
||||
"<span class='notice'>You have cleaned \the [src].</span>" \
|
||||
)
|
||||
src.dirty = 0 // It's clean!
|
||||
src.broken = 0 // just to be sure
|
||||
src.icon_state = off_icon
|
||||
src.flags = OPENCONTAINER
|
||||
else //Otherwise bad luck!!
|
||||
user << "<span class='alert'>It's dirty!</span>"
|
||||
return 1
|
||||
else if(is_type_in_list(O,acceptable_items))
|
||||
if (contents.len>=max_n_of_items)
|
||||
user << "<span class='alert'>This [src] is full of ingredients, you cannot put more.</span>"
|
||||
return 1
|
||||
if (istype(O,/obj/item/stack) && O:amount>1)
|
||||
new O.type (src)
|
||||
O:use(1)
|
||||
user.visible_message( \
|
||||
"<span class='notice'>[user] has added one of [O] to \the [src].</span>", \
|
||||
"<span class='notice'>You add one of [O] to \the [src].</span>")
|
||||
else
|
||||
// user.unEquip(O) //This just causes problems so far as I can tell. -Pete
|
||||
if(!user.drop_item())
|
||||
user << "<span class='notice'>\The [O] is stuck to your hand, you cannot put it in \the [src]</span>"
|
||||
return 0
|
||||
O.loc = src
|
||||
user.visible_message( \
|
||||
"<span class='notice'>[user] has added \the [O] to \the [src].</span>", \
|
||||
"<span class='notice'>You add \the [O] to \the [src].</span>")
|
||||
else if(istype(O,/obj/item/weapon/reagent_containers/glass) || \
|
||||
istype(O,/obj/item/weapon/reagent_containers/food/drinks) || \
|
||||
istype(O,/obj/item/weapon/reagent_containers/food/condiment) \
|
||||
)
|
||||
if (!O.reagents)
|
||||
return 1
|
||||
for (var/datum/reagent/R in O.reagents.reagent_list)
|
||||
if (!(R.id in acceptable_reagents))
|
||||
user << "<span class='alert'>Your [O] contains components unsuitable for cookery.</span>"
|
||||
return 1
|
||||
//G.reagents.trans_to(src,G.amount_per_transfer_from_this)
|
||||
else if(istype(O,/obj/item/weapon/grab))
|
||||
var/obj/item/weapon/grab/G = O
|
||||
user << "<span class='alert'>This is ridiculous. You can not fit \the [G.affecting] in this [src].</span>"
|
||||
return 1
|
||||
else
|
||||
user << "<span class='alert'>You have no idea what you can cook with this [O].</span>"
|
||||
return 1
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/kitchen_machine/attack_ai(mob/user as mob)
|
||||
return 0
|
||||
|
||||
/obj/machinery/kitchen_machine/attack_hand(mob/user as mob)
|
||||
user.set_machine(src)
|
||||
interact(user)
|
||||
|
||||
/********************
|
||||
* Machine Menu *
|
||||
********************/
|
||||
|
||||
/obj/machinery/kitchen_machine/interact(mob/user as mob) // The microwave Menu
|
||||
if(panel_open || !anchored)
|
||||
return
|
||||
var/dat = ""
|
||||
if(src.broken > 0)
|
||||
dat = {"<TT>Bzzzzttttt</TT>"}
|
||||
else if(src.operating)
|
||||
dat = {"<TT>[pick(src.cook_verbs)] in progress!<BR>Please wait...!</TT>"}
|
||||
else if(src.dirty==100)
|
||||
dat = {"<TT>This [src] is dirty!<BR>Please clean it before use!</TT>"}
|
||||
else
|
||||
var/list/items_counts = new
|
||||
var/list/items_measures = new
|
||||
var/list/items_measures_p = new
|
||||
for (var/obj/O in contents)
|
||||
var/display_name = O.name
|
||||
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/egg))
|
||||
items_measures[display_name] = "egg"
|
||||
items_measures_p[display_name] = "eggs"
|
||||
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/tofu))
|
||||
items_measures[display_name] = "tofu chunk"
|
||||
items_measures_p[display_name] = "tofu chunks"
|
||||
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/meat)) //any meat
|
||||
items_measures[display_name] = "slab of meat"
|
||||
items_measures_p[display_name] = "slabs of meat"
|
||||
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/donkpocket))
|
||||
display_name = "Turnovers"
|
||||
items_measures[display_name] = "turnover"
|
||||
items_measures_p[display_name] = "turnovers"
|
||||
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/carpmeat))
|
||||
items_measures[display_name] = "fillet of meat"
|
||||
items_measures_p[display_name] = "fillets of meat"
|
||||
items_counts[display_name]++
|
||||
for (var/O in items_counts)
|
||||
var/N = items_counts[O]
|
||||
if (!(O in items_measures))
|
||||
dat += {"<B>[capitalize(O)]:</B> [N] [lowertext(O)]\s<BR>"}
|
||||
else
|
||||
if (N==1)
|
||||
dat += {"<B>[capitalize(O)]:</B> [N] [items_measures[O]]<BR>"}
|
||||
else
|
||||
dat += {"<B>[capitalize(O)]:</B> [N] [items_measures_p[O]]<BR>"}
|
||||
|
||||
for (var/datum/reagent/R in reagents.reagent_list)
|
||||
var/display_name = R.name
|
||||
if (R.id == "capsaicin")
|
||||
display_name = "Hotsauce"
|
||||
if (R.id == "frostoil")
|
||||
display_name = "Coldsauce"
|
||||
dat += {"<B>[display_name]:</B> [R.volume] unit\s<BR>"}
|
||||
|
||||
if (items_counts.len==0 && reagents.reagent_list.len==0)
|
||||
dat = {"<B>The [src] is empty</B><BR>"}
|
||||
else
|
||||
dat = {"<b>Ingredients:</b><br>[dat]"}
|
||||
dat += {"<HR><BR>\
|
||||
<A href='?src=\ref[src];action=cook'>Turn on!<BR>\
|
||||
<A href='?src=\ref[src];action=dispose'>Eject ingredients!<BR>\
|
||||
"}
|
||||
|
||||
user << browse("<HEAD><TITLE>[src] Controls</TITLE></HEAD><TT>[dat]</TT>", "window=[src.name]")
|
||||
onclose(user, "[src.name]")
|
||||
return
|
||||
|
||||
|
||||
|
||||
/************************************
|
||||
* Machine Menu Handling/Cooking *
|
||||
************************************/
|
||||
|
||||
/obj/machinery/kitchen_machine/proc/cook()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
start()
|
||||
if (reagents.total_volume==0 && !(locate(/obj) in contents)) //dry run
|
||||
if (!wzhzhzh(10))
|
||||
abort()
|
||||
return
|
||||
stop()
|
||||
return
|
||||
|
||||
var/datum/recipe/recipe = select_recipe(available_recipes,src)
|
||||
var/obj/cooked
|
||||
var/obj/byproduct
|
||||
if (!recipe)
|
||||
dirty += 1
|
||||
if (prob(max(10,dirty*5)))
|
||||
if (!wzhzhzh(4))
|
||||
abort()
|
||||
return
|
||||
muck_start()
|
||||
wzhzhzh(4)
|
||||
muck_finish()
|
||||
fail()
|
||||
return
|
||||
else if (has_extra_item())
|
||||
if (!wzhzhzh(4))
|
||||
abort()
|
||||
return
|
||||
broke()
|
||||
fail()
|
||||
return
|
||||
else
|
||||
if (!wzhzhzh(10))
|
||||
abort()
|
||||
return
|
||||
stop()
|
||||
fail()
|
||||
return
|
||||
else
|
||||
var/halftime = round(recipe.time/10/2)
|
||||
if (!wzhzhzh(halftime))
|
||||
abort()
|
||||
return
|
||||
if (!wzhzhzh(halftime))
|
||||
abort()
|
||||
fail()
|
||||
return
|
||||
cooked = recipe.make_food(src)
|
||||
byproduct = recipe.get_byproduct()
|
||||
stop()
|
||||
if(cooked)
|
||||
cooked.loc = src.loc
|
||||
for(var/i=1,i<efficiency,i++)
|
||||
cooked = new cooked.type(loc)
|
||||
if(byproduct)
|
||||
new byproduct(loc)
|
||||
return
|
||||
|
||||
/obj/machinery/kitchen_machine/proc/wzhzhzh(var/seconds as num)
|
||||
for (var/i=1 to seconds)
|
||||
if (stat & (NOPOWER|BROKEN))
|
||||
return 0
|
||||
use_power(500)
|
||||
sleep(10)
|
||||
return 1
|
||||
|
||||
/obj/machinery/kitchen_machine/proc/has_extra_item()
|
||||
for (var/obj/O in contents)
|
||||
if ( \
|
||||
!istype(O,/obj/item/weapon/reagent_containers/food) && \
|
||||
!istype(O, /obj/item/weapon/grown) \
|
||||
)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/kitchen_machine/proc/start()
|
||||
src.visible_message("<span class='notice'>\The [src] turns on.</span>", "<span class='notice'>You hear \a [src].</span>")
|
||||
src.operating = 1
|
||||
src.icon_state = on_icon
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/kitchen_machine/proc/abort()
|
||||
src.operating = 0 // Turn it off again aferwards
|
||||
src.icon_state = off_icon
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/kitchen_machine/proc/stop()
|
||||
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1)
|
||||
src.operating = 0 // Turn it off again aferwards
|
||||
src.icon_state = off_icon
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/kitchen_machine/proc/dispose()
|
||||
for (var/obj/O in contents)
|
||||
O.loc = src.loc
|
||||
if (src.reagents.total_volume)
|
||||
src.dirty++
|
||||
src.reagents.clear_reagents()
|
||||
usr << "<span class='notice'>You dispose of \the [src]'s contents.</span>"
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/kitchen_machine/proc/muck_start()
|
||||
playsound(src.loc, 'sound/effects/splat.ogg', 50, 1) // Play a splat sound
|
||||
src.icon_state = dirty_icon // Make it look dirty!!
|
||||
|
||||
/obj/machinery/kitchen_machine/proc/muck_finish()
|
||||
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1)
|
||||
src.visible_message("<span class='alert'>\The [src] gets covered in muck!</span>")
|
||||
src.dirty = 100 // Make it dirty so it can't be used util cleaned
|
||||
src.flags = null //So you can't add condiments
|
||||
src.icon_state = dirty_icon // Make it look dirty too
|
||||
src.operating = 0 // Turn it off again aferwards
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/kitchen_machine/proc/broke()
|
||||
var/datum/effect/effect/system/spark_spread/s = new
|
||||
s.set_up(2, 1, src)
|
||||
s.start()
|
||||
src.icon_state = broken_icon // Make it look all busted up and shit
|
||||
src.visible_message("<span class='alert'>The [src] breaks!</span>") //Let them know they're stupid
|
||||
src.broken = 2 // Make it broken so it can't be used util fixed
|
||||
src.flags = null //So you can't add condiments
|
||||
src.operating = 0 // Turn it off again aferwards
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/kitchen_machine/proc/fail()
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/badrecipe/ffuu = new(src)
|
||||
var/amount = 0
|
||||
for (var/obj/O in contents-ffuu)
|
||||
amount++
|
||||
if (O.reagents)
|
||||
var/id = O.reagents.get_master_reagent_id()
|
||||
if (id)
|
||||
amount+=O.reagents.get_reagent_amount(id)
|
||||
qdel(O)
|
||||
src.reagents.clear_reagents()
|
||||
ffuu.reagents.add_reagent("carbon", amount)
|
||||
ffuu.reagents.add_reagent("????", amount/10)
|
||||
ffuu.loc = get_turf(src)
|
||||
|
||||
/obj/machinery/kitchen_machine/Topic(href, href_list)
|
||||
if(..() || panel_open)
|
||||
return
|
||||
|
||||
usr.set_machine(src)
|
||||
if(src.operating)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
switch(href_list["action"])
|
||||
if ("cook")
|
||||
cook()
|
||||
|
||||
if ("dispose")
|
||||
dispose()
|
||||
return
|
||||
@@ -1,24 +1,16 @@
|
||||
|
||||
/obj/machinery/microwave
|
||||
/obj/machinery/kitchen_machine/microwave
|
||||
name = "Microwave"
|
||||
desc = "A microwave, perfect for reheating things with radiation."
|
||||
icon = 'icons/obj/kitchen.dmi'
|
||||
icon_state = "mw"
|
||||
layer = 2.9
|
||||
density = 1
|
||||
anchored = 1
|
||||
use_power = 1
|
||||
idle_power_usage = 5
|
||||
active_power_usage = 100
|
||||
flags = OPENCONTAINER | NOREACT
|
||||
var/operating = 0 // Is it on?
|
||||
var/dirty = 0 // = {0..100} Does it need cleaning?
|
||||
var/broken = 0 // ={0,1,2} How broken is it???
|
||||
var/global/list/datum/recipe/available_recipes // List of the recipes you can use
|
||||
var/global/list/acceptable_items // List of the items you can put in
|
||||
var/global/list/acceptable_reagents // List of the reagents you can put in
|
||||
var/global/max_n_of_items = 0
|
||||
var/efficiency
|
||||
|
||||
cook_verbs = list("Microwaving", "Reheating", "Heating")
|
||||
recipe_type = /datum/recipe/microwave
|
||||
off_icon = "mw"
|
||||
on_icon = "mw1"
|
||||
broken_icon = "mwb"
|
||||
dirty_icon = "mwbloody"
|
||||
open_icon = "mw-o"
|
||||
|
||||
// see code/modules/food/recipes_microwave.dm for recipes
|
||||
|
||||
@@ -26,29 +18,8 @@
|
||||
* Initialising
|
||||
********************/
|
||||
|
||||
/obj/machinery/microwave/New()
|
||||
//..() //do not need this
|
||||
reagents = new/datum/reagents(100)
|
||||
reagents.my_atom = src
|
||||
if (!available_recipes)
|
||||
available_recipes = new
|
||||
for (var/type in (typesof(/datum/recipe/microwave)-/datum/recipe/microwave))
|
||||
var/datum/recipe/recipe = new type
|
||||
if(recipe.result) // Ignore recipe subtypes that lack a result
|
||||
available_recipes += recipe
|
||||
else
|
||||
qdel(recipe)
|
||||
acceptable_items = new
|
||||
acceptable_reagents = new
|
||||
for (var/datum/recipe/microwave/recipe in available_recipes)
|
||||
for (var/item in recipe.items)
|
||||
acceptable_items |= item
|
||||
for (var/reagent in recipe.reagents)
|
||||
acceptable_reagents |= reagent
|
||||
if (recipe.items)
|
||||
max_n_of_items = max(max_n_of_items,recipe.items.len)
|
||||
acceptable_items |= /obj/item/weapon/reagent_containers/food/snacks/grown
|
||||
|
||||
/obj/machinery/kitchen_machine/microwave/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/microwave(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/micro_laser(null)
|
||||
@@ -56,8 +27,7 @@
|
||||
component_parts += new /obj/item/stack/cable_coil(null, 2)
|
||||
RefreshParts()
|
||||
|
||||
|
||||
/obj/machinery/microwave/upgraded/New()
|
||||
/obj/machinery/kitchen_machine/microwave/upgraded/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/microwave(null)
|
||||
@@ -66,358 +36,20 @@
|
||||
component_parts += new /obj/item/stack/cable_coil(null, 2)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/microwave/RefreshParts()
|
||||
/obj/machinery/kitchen_machine/microwave/RefreshParts()
|
||||
var/E
|
||||
for(var/obj/item/weapon/stock_parts/micro_laser/M in component_parts)
|
||||
E += M.rating
|
||||
efficiency = E
|
||||
|
||||
/*******************
|
||||
* Item Adding
|
||||
********************/
|
||||
// The following code is present as temporary assurance for compatibility and to avoid merge conflicts for the TG mining port
|
||||
// Please delete this portion once all maps are updated to use the new object path: /obj/machinery/kitchen_machine/microwave
|
||||
|
||||
/obj/machinery/microwave/attackby(var/obj/item/O as obj, var/mob/user as mob, params)
|
||||
if(operating)
|
||||
return
|
||||
if(!broken && dirty < 100)
|
||||
if(default_deconstruction_screwdriver(user, "mw-o", "mw", O))
|
||||
return
|
||||
if(exchange_parts(user, O))
|
||||
return
|
||||
if(!broken && istype(O, /obj/item/weapon/wrench))
|
||||
playsound(src, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
if(anchored)
|
||||
anchored = 0
|
||||
user << "<span class='caution'>The [src] can now be moved.</span>"
|
||||
return
|
||||
else if(!anchored)
|
||||
anchored = 1
|
||||
user << "<span class='caution'>The [src] is now secured.</span>"
|
||||
return
|
||||
/obj/machinery/microwave
|
||||
name = "Microwave spawner"
|
||||
icon = 'icons/obj/kitchen.dmi'
|
||||
icon_state = "mw"
|
||||
|
||||
default_deconstruction_crowbar(O)
|
||||
|
||||
if(src.broken > 0)
|
||||
if(src.broken == 2 && istype(O, /obj/item/weapon/screwdriver)) // If it's broken and they're using a screwdriver
|
||||
user.visible_message( \
|
||||
"\blue [user] starts to fix part of the microwave.", \
|
||||
"\blue You start to fix part of the microwave." \
|
||||
)
|
||||
if (do_after(user,20))
|
||||
user.visible_message( \
|
||||
"\blue [user] fixes part of the microwave.", \
|
||||
"\blue You have fixed part of the microwave." \
|
||||
)
|
||||
src.broken = 1 // Fix it a bit
|
||||
else if(src.broken == 1 && istype(O, /obj/item/weapon/wrench)) // If it's broken and they're doing the wrench
|
||||
user.visible_message( \
|
||||
"\blue [user] starts to fix part of the microwave.", \
|
||||
"\blue You start to fix part of the microwave." \
|
||||
)
|
||||
if (do_after(user,20))
|
||||
user.visible_message( \
|
||||
"\blue [user] fixes the microwave.", \
|
||||
"\blue You have fixed the microwave." \
|
||||
)
|
||||
src.icon_state = "mw"
|
||||
src.broken = 0 // Fix it!
|
||||
src.dirty = 0 // just to be sure
|
||||
src.flags = OPENCONTAINER
|
||||
else
|
||||
user << "\red It's broken!"
|
||||
return 1
|
||||
else if(src.dirty==100) // The microwave is all dirty so can't be used!
|
||||
if(istype(O, /obj/item/weapon/reagent_containers/spray/cleaner) || istype(O, /obj/item/weapon/soap)) // If they're trying to clean it then let them
|
||||
user.visible_message( \
|
||||
"\blue [user] starts to clean the microwave.", \
|
||||
"\blue You start to clean the microwave." \
|
||||
)
|
||||
if (do_after(user,20))
|
||||
user.visible_message( \
|
||||
"\blue [user] has cleaned the microwave.", \
|
||||
"\blue You have cleaned the microwave." \
|
||||
)
|
||||
src.dirty = 0 // It's clean!
|
||||
src.broken = 0 // just to be sure
|
||||
src.icon_state = "mw"
|
||||
src.flags = OPENCONTAINER
|
||||
else //Otherwise bad luck!!
|
||||
user << "\red It's dirty!"
|
||||
return 1
|
||||
else if(is_type_in_list(O,acceptable_items))
|
||||
if (contents.len>=max_n_of_items)
|
||||
user << "\red This [src] is full of ingredients, you cannot put more."
|
||||
return 1
|
||||
if (istype(O,/obj/item/stack) && O:amount>1)
|
||||
new O.type (src)
|
||||
O:use(1)
|
||||
user.visible_message( \
|
||||
"\blue [user] has added one of [O] to \the [src].", \
|
||||
"\blue You add one of [O] to \the [src].")
|
||||
else
|
||||
// user.unEquip(O) //This just causes problems so far as I can tell. -Pete
|
||||
if(!user.drop_item())
|
||||
user << "<span class='notice'>\the [O] is stuck to your hand, you cannot put it in \the [src]</span>"
|
||||
return 0
|
||||
O.loc = src
|
||||
user.visible_message( \
|
||||
"\blue [user] has added \the [O] to \the [src].", \
|
||||
"\blue You add \the [O] to \the [src].")
|
||||
else if(istype(O,/obj/item/weapon/reagent_containers/glass) || \
|
||||
istype(O,/obj/item/weapon/reagent_containers/food/drinks) || \
|
||||
istype(O,/obj/item/weapon/reagent_containers/food/condiment) \
|
||||
)
|
||||
if (!O.reagents)
|
||||
return 1
|
||||
for (var/datum/reagent/R in O.reagents.reagent_list)
|
||||
if (!(R.id in acceptable_reagents))
|
||||
user << "\red Your [O] contains components unsuitable for cookery."
|
||||
return 1
|
||||
//G.reagents.trans_to(src,G.amount_per_transfer_from_this)
|
||||
else if(istype(O,/obj/item/weapon/grab))
|
||||
var/obj/item/weapon/grab/G = O
|
||||
user << "\red This is ridiculous. You can not fit \the [G.affecting] in this [src]."
|
||||
return 1
|
||||
else
|
||||
user << "\red You have no idea what you can cook with this [O]."
|
||||
return 1
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/microwave/attack_ai(mob/user as mob)
|
||||
return 0
|
||||
|
||||
/obj/machinery/microwave/attack_hand(mob/user as mob)
|
||||
user.set_machine(src)
|
||||
interact(user)
|
||||
|
||||
/*******************
|
||||
* Microwave Menu
|
||||
********************/
|
||||
|
||||
/obj/machinery/microwave/interact(mob/user as mob) // The microwave Menu
|
||||
if(panel_open || !anchored)
|
||||
return
|
||||
var/dat = ""
|
||||
if(src.broken > 0)
|
||||
dat = {"<TT>Bzzzzttttt</TT>"}
|
||||
else if(src.operating)
|
||||
dat = {"<TT>Microwaving in progress!<BR>Please wait...!</TT>"}
|
||||
else if(src.dirty==100)
|
||||
dat = {"<TT>This microwave is dirty!<BR>Please clean it before use!</TT>"}
|
||||
else
|
||||
var/list/items_counts = new
|
||||
var/list/items_measures = new
|
||||
var/list/items_measures_p = new
|
||||
for (var/obj/O in contents)
|
||||
var/display_name = O.name
|
||||
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/egg))
|
||||
items_measures[display_name] = "egg"
|
||||
items_measures_p[display_name] = "eggs"
|
||||
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/tofu))
|
||||
items_measures[display_name] = "tofu chunk"
|
||||
items_measures_p[display_name] = "tofu chunks"
|
||||
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/meat)) //any meat
|
||||
items_measures[display_name] = "slab of meat"
|
||||
items_measures_p[display_name] = "slabs of meat"
|
||||
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/donkpocket))
|
||||
display_name = "Turnovers"
|
||||
items_measures[display_name] = "turnover"
|
||||
items_measures_p[display_name] = "turnovers"
|
||||
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/carpmeat))
|
||||
items_measures[display_name] = "fillet of meat"
|
||||
items_measures_p[display_name] = "fillets of meat"
|
||||
items_counts[display_name]++
|
||||
for (var/O in items_counts)
|
||||
var/N = items_counts[O]
|
||||
if (!(O in items_measures))
|
||||
dat += {"<B>[capitalize(O)]:</B> [N] [lowertext(O)]\s<BR>"}
|
||||
else
|
||||
if (N==1)
|
||||
dat += {"<B>[capitalize(O)]:</B> [N] [items_measures[O]]<BR>"}
|
||||
else
|
||||
dat += {"<B>[capitalize(O)]:</B> [N] [items_measures_p[O]]<BR>"}
|
||||
|
||||
for (var/datum/reagent/R in reagents.reagent_list)
|
||||
var/display_name = R.name
|
||||
if (R.id == "capsaicin")
|
||||
display_name = "Hotsauce"
|
||||
if (R.id == "frostoil")
|
||||
display_name = "Coldsauce"
|
||||
dat += {"<B>[display_name]:</B> [R.volume] unit\s<BR>"}
|
||||
|
||||
if (items_counts.len==0 && reagents.reagent_list.len==0)
|
||||
dat = {"<B>The microwave is empty</B><BR>"}
|
||||
else
|
||||
dat = {"<b>Ingredients:</b><br>[dat]"}
|
||||
dat += {"<HR><BR>\
|
||||
<A href='?src=\ref[src];action=cook'>Turn on!<BR>\
|
||||
<A href='?src=\ref[src];action=dispose'>Eject ingredients!<BR>\
|
||||
"}
|
||||
|
||||
user << browse("<HEAD><TITLE>Microwave Controls</TITLE></HEAD><TT>[dat]</TT>", "window=microwave")
|
||||
onclose(user, "microwave")
|
||||
return
|
||||
|
||||
|
||||
|
||||
/***********************************
|
||||
* Microwave Menu Handling/Cooking
|
||||
************************************/
|
||||
|
||||
/obj/machinery/microwave/proc/cook()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
start()
|
||||
if (reagents.total_volume==0 && !(locate(/obj) in contents)) //dry run
|
||||
if (!wzhzhzh(10))
|
||||
abort()
|
||||
return
|
||||
stop()
|
||||
return
|
||||
|
||||
var/datum/recipe/recipe = select_recipe(available_recipes,src)
|
||||
var/obj/cooked
|
||||
if (!recipe)
|
||||
dirty += 1
|
||||
if (prob(max(10,dirty*5)))
|
||||
if (!wzhzhzh(4))
|
||||
abort()
|
||||
return
|
||||
muck_start()
|
||||
wzhzhzh(4)
|
||||
muck_finish()
|
||||
cooked = fail()
|
||||
cooked.loc = src.loc
|
||||
return
|
||||
else if (has_extra_item())
|
||||
if (!wzhzhzh(4))
|
||||
abort()
|
||||
return
|
||||
broke()
|
||||
cooked = fail()
|
||||
cooked.loc = src.loc
|
||||
return
|
||||
else
|
||||
if (!wzhzhzh(10))
|
||||
abort()
|
||||
return
|
||||
stop()
|
||||
cooked = fail()
|
||||
cooked.loc = src.loc
|
||||
return
|
||||
else
|
||||
var/halftime = round(recipe.time/10/2)
|
||||
if (!wzhzhzh(halftime))
|
||||
abort()
|
||||
return
|
||||
if (!wzhzhzh(halftime))
|
||||
abort()
|
||||
cooked = fail()
|
||||
cooked.loc = src.loc
|
||||
return
|
||||
cooked = recipe.make_food(src)
|
||||
stop()
|
||||
if(cooked)
|
||||
cooked.loc = src.loc
|
||||
for(var/i=1,i<efficiency,i++)
|
||||
cooked = new cooked.type(loc)
|
||||
return
|
||||
|
||||
/obj/machinery/microwave/proc/wzhzhzh(var/seconds as num)
|
||||
for (var/i=1 to seconds)
|
||||
if (stat & (NOPOWER|BROKEN))
|
||||
return 0
|
||||
use_power(500)
|
||||
sleep(10)
|
||||
return 1
|
||||
|
||||
/obj/machinery/microwave/proc/has_extra_item()
|
||||
for (var/obj/O in contents)
|
||||
if ( \
|
||||
!istype(O,/obj/item/weapon/reagent_containers/food) && \
|
||||
!istype(O, /obj/item/weapon/grown) \
|
||||
)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/microwave/proc/start()
|
||||
src.visible_message("\blue The microwave turns on.", "\blue You hear a microwave.")
|
||||
src.operating = 1
|
||||
src.icon_state = "mw1"
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/microwave/proc/abort()
|
||||
src.operating = 0 // Turn it off again aferwards
|
||||
src.icon_state = "mw"
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/microwave/proc/stop()
|
||||
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1)
|
||||
src.operating = 0 // Turn it off again aferwards
|
||||
src.icon_state = "mw"
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/microwave/proc/dispose()
|
||||
for (var/obj/O in contents)
|
||||
O.loc = src.loc
|
||||
if (src.reagents.total_volume)
|
||||
src.dirty++
|
||||
src.reagents.clear_reagents()
|
||||
usr << "\blue You dispose of the microwave contents."
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/microwave/proc/muck_start()
|
||||
playsound(src.loc, 'sound/effects/splat.ogg', 50, 1) // Play a splat sound
|
||||
src.icon_state = "mwbloody1" // Make it look dirty!!
|
||||
|
||||
/obj/machinery/microwave/proc/muck_finish()
|
||||
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1)
|
||||
src.visible_message("\red The microwave gets covered in muck!")
|
||||
src.dirty = 100 // Make it dirty so it can't be used util cleaned
|
||||
src.flags = null //So you can't add condiments
|
||||
src.icon_state = "mwbloody" // Make it look dirty too
|
||||
src.operating = 0 // Turn it off again aferwards
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/microwave/proc/broke()
|
||||
var/datum/effect/effect/system/spark_spread/s = new
|
||||
s.set_up(2, 1, src)
|
||||
s.start()
|
||||
src.icon_state = "mwb" // Make it look all busted up and shit
|
||||
src.visible_message("\red The microwave breaks!") //Let them know they're stupid
|
||||
src.broken = 2 // Make it broken so it can't be used util fixed
|
||||
src.flags = null //So you can't add condiments
|
||||
src.operating = 0 // Turn it off again aferwards
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/microwave/proc/fail()
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/badrecipe/ffuu = new(src)
|
||||
var/amount = 0
|
||||
for (var/obj/O in contents-ffuu)
|
||||
amount++
|
||||
if (O.reagents)
|
||||
var/id = O.reagents.get_master_reagent_id()
|
||||
if (id)
|
||||
amount+=O.reagents.get_reagent_amount(id)
|
||||
qdel(O)
|
||||
src.reagents.clear_reagents()
|
||||
ffuu.reagents.add_reagent("carbon", amount)
|
||||
ffuu.reagents.add_reagent("????", amount/10)
|
||||
return ffuu
|
||||
|
||||
/obj/machinery/microwave/Topic(href, href_list)
|
||||
if(..() || panel_open)
|
||||
return
|
||||
|
||||
usr.set_machine(src)
|
||||
if(src.operating)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
switch(href_list["action"])
|
||||
if ("cook")
|
||||
cook()
|
||||
|
||||
if ("dispose")
|
||||
dispose()
|
||||
return
|
||||
/obj/machinery/microwave/New()
|
||||
new /obj/machinery/kitchen_machine/microwave(get_turf(src))
|
||||
qdel(src)
|
||||
@@ -96,6 +96,7 @@ Class Procs:
|
||||
/obj/machinery
|
||||
name = "machinery"
|
||||
icon = 'icons/obj/stationobjs.dmi'
|
||||
pressure_resistance = 10
|
||||
var/stat = 0
|
||||
var/emagged = 0
|
||||
var/use_power = 1
|
||||
|
||||
@@ -180,8 +180,8 @@
|
||||
HI.Insert(I, frame=1, delay = 5)
|
||||
HI.Insert(J, frame=2, delay = 5)
|
||||
|
||||
del(I)
|
||||
del(J)
|
||||
qdel(I)
|
||||
qdel(J)
|
||||
H.icon = HI
|
||||
H.layer = 25
|
||||
usr.mapobjs += H
|
||||
@@ -306,7 +306,7 @@
|
||||
var/icon/I = imap[i+1]
|
||||
|
||||
H.icon = I
|
||||
del(I)
|
||||
qdel(I)
|
||||
H.layer = 25
|
||||
usr.mapobjs += H
|
||||
|
||||
@@ -353,7 +353,7 @@ proc/getb(col)
|
||||
/mob/proc/clearmap()
|
||||
src.client.screen -= src.mapobjs
|
||||
for(var/obj/screen/O in mapobjs)
|
||||
del(O)
|
||||
qdel(O)
|
||||
|
||||
mapobjs = null
|
||||
src.unset_machine()
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
race = "<i>Unidentifiable</i>"
|
||||
language = race
|
||||
|
||||
del(M)
|
||||
qdel(M)
|
||||
|
||||
// -- If the orator is a human, or universal translate is active, OR mob has universal speech on --
|
||||
|
||||
|
||||
@@ -427,7 +427,7 @@ steam.start() -- spawns the effect
|
||||
if(seed_name && plant_controller)
|
||||
seed = plant_controller.seeds[seed_name]
|
||||
if(!seed)
|
||||
del(src)
|
||||
qdel(src)
|
||||
..()
|
||||
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
var/w_class = 3.0
|
||||
var/slot_flags = 0 //This is used to determine on which slots an item can fit.
|
||||
pass_flags = PASSTABLE
|
||||
pressure_resistance = 5
|
||||
pressure_resistance = 3
|
||||
// causeerrorheresoifixthis
|
||||
var/obj/item/master = null
|
||||
|
||||
|
||||
@@ -233,7 +233,7 @@
|
||||
usr.client.screen -= S
|
||||
S.dropped(usr)
|
||||
if(!S.amount)
|
||||
del S
|
||||
del(S)
|
||||
else
|
||||
S.loc = src
|
||||
|
||||
@@ -278,7 +278,7 @@
|
||||
N.amount = stacksize
|
||||
S.amount -= stacksize
|
||||
if(!S.amount)
|
||||
del S // todo: there's probably something missing here
|
||||
del(S) // todo: there's probably something missing here
|
||||
orient2hud(usr)
|
||||
if(usr.s_active)
|
||||
usr.s_active.show_to(usr)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/obj/structure
|
||||
icon = 'icons/obj/structures.dmi'
|
||||
pressure_resistance = 8
|
||||
var/climbable
|
||||
var/mob/climber
|
||||
|
||||
|
||||
@@ -188,6 +188,7 @@
|
||||
new /obj/item/weapon/storage/belt/security/sec(src)
|
||||
new /obj/item/clothing/mask/gas/sechailer(src)
|
||||
new /obj/item/clothing/glasses/sunglasses/sechud(src)
|
||||
new /obj/item/clothing/head/helmet(src)
|
||||
new /obj/item/weapon/melee/baton/loaded(src)
|
||||
new /obj/item/taperoll/police(src)
|
||||
return
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
icon = 'icons/obj/janitor.dmi'
|
||||
icon_state = "mopbucket"
|
||||
density = 1
|
||||
pressure_resistance = 5
|
||||
flags = OPENCONTAINER
|
||||
var/amount_per_transfer_from_this = 5 //shit I dunno, adding this so syringes stop runtime erroring. --NeoFite
|
||||
|
||||
@@ -12,7 +11,7 @@
|
||||
var/datum/reagents/R = new/datum/reagents(100)
|
||||
reagents = R
|
||||
R.my_atom = src
|
||||
|
||||
|
||||
/obj/structure/mopbucket/full/New()
|
||||
..()
|
||||
reagents.add_reagent("water", 100)
|
||||
|
||||
@@ -21,10 +21,10 @@
|
||||
anchored = 1.0
|
||||
|
||||
/obj/structure/morgue/proc/update()
|
||||
if(src.connected)
|
||||
src.icon_state = "morgue0"
|
||||
if(connected)
|
||||
icon_state = "morgue0"
|
||||
else
|
||||
if(src.contents.len)
|
||||
if(contents.len)
|
||||
|
||||
var/mob/living/M = locate() in contents
|
||||
|
||||
@@ -35,14 +35,14 @@
|
||||
var/mob/dead/observer/G = M.get_ghost()
|
||||
|
||||
if(M.client)
|
||||
src.icon_state = "morgue3"
|
||||
icon_state = "morgue3"
|
||||
else if(G && G.client) //There is a ghost and it is connected to the server
|
||||
src.icon_state = "morgue5"
|
||||
icon_state = "morgue5"
|
||||
else
|
||||
src.icon_state = "morgue2"
|
||||
icon_state = "morgue2"
|
||||
|
||||
else src.icon_state = "morgue4"
|
||||
else src.icon_state = "morgue1"
|
||||
else icon_state = "morgue4"
|
||||
else icon_state = "morgue1"
|
||||
return
|
||||
|
||||
|
||||
@@ -50,94 +50,99 @@
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
A.loc = loc
|
||||
ex_act(severity)
|
||||
qdel(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
A.loc = loc
|
||||
ex_act(severity)
|
||||
qdel(src)
|
||||
return
|
||||
if(3.0)
|
||||
if (prob(5))
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
A.loc = loc
|
||||
ex_act(severity)
|
||||
qdel(src)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/structure/morgue/alter_health()
|
||||
return src.loc
|
||||
return loc
|
||||
|
||||
|
||||
/obj/structure/morgue/attack_hand(mob/user as mob)
|
||||
if (src.connected)
|
||||
for(var/atom/movable/A as mob|obj in src.connected.loc)
|
||||
if (connected)
|
||||
for(var/atom/movable/A as mob|obj in connected.loc)
|
||||
if (!( A.anchored ))
|
||||
A.loc = src
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
//src.connected = null
|
||||
qdel(src.connected)
|
||||
playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
qdel(connected)
|
||||
connected = null
|
||||
else
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
src.connected = new /obj/structure/m_tray( src.loc )
|
||||
step(src.connected, src.dir)
|
||||
src.connected.layer = OBJ_LAYER
|
||||
var/turf/T = get_step(src, src.dir)
|
||||
if (T.contents.Find(src.connected))
|
||||
src.connected.connected = src
|
||||
src.icon_state = "morgue0"
|
||||
playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
connected = new /obj/structure/m_tray( loc )
|
||||
step(connected, dir)
|
||||
connected.layer = OBJ_LAYER
|
||||
var/turf/T = get_step(src, dir)
|
||||
if (T.contents.Find(connected))
|
||||
connected.connected = src
|
||||
icon_state = "morgue0"
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.connected.loc
|
||||
src.connected.icon_state = "morguet"
|
||||
src.connected.dir = src.dir
|
||||
A.loc = connected.loc
|
||||
connected.icon_state = "morguet"
|
||||
connected.dir = dir
|
||||
else
|
||||
//src.connected = null
|
||||
qdel(src.connected)
|
||||
src.add_fingerprint(user)
|
||||
qdel(connected)
|
||||
connected = null
|
||||
add_fingerprint(user)
|
||||
update()
|
||||
return
|
||||
|
||||
/obj/structure/morgue/attackby(P as obj, mob/user as mob, params)
|
||||
if (istype(P, /obj/item/weapon/pen))
|
||||
var/t = input(user, "What would you like the label to be?", text("[]", src.name), null) as text
|
||||
var/t = input(user, "What would you like the label to be?", text("[]", name), null) as text
|
||||
if (user.get_active_hand() != P)
|
||||
return
|
||||
if ((!in_range(src, usr) && src.loc != user))
|
||||
if ((!in_range(src, usr) && loc != user))
|
||||
return
|
||||
t = sanitize(copytext(t,1,MAX_MESSAGE_LEN))
|
||||
if (t)
|
||||
src.name = text("Morgue- '[]'", t)
|
||||
src.overlays += image(src.icon, "morgue_label")
|
||||
name = text("Morgue- '[]'", t)
|
||||
overlays += image(icon, "morgue_label")
|
||||
else
|
||||
src.name = "Morgue"
|
||||
src.overlays.Cut()
|
||||
src.add_fingerprint(user)
|
||||
name = "Morgue"
|
||||
overlays.Cut()
|
||||
add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/structure/morgue/relaymove(mob/user as mob)
|
||||
if (user.stat)
|
||||
return
|
||||
src.connected = new /obj/structure/m_tray( src.loc )
|
||||
step(src.connected, EAST)
|
||||
src.connected.layer = OBJ_LAYER
|
||||
connected = new /obj/structure/m_tray( loc )
|
||||
step(connected, EAST)
|
||||
connected.layer = OBJ_LAYER
|
||||
var/turf/T = get_step(src, EAST)
|
||||
if (T.contents.Find(src.connected))
|
||||
src.connected.connected = src
|
||||
src.icon_state = "morgue0"
|
||||
if (T.contents.Find(connected))
|
||||
connected.connected = src
|
||||
icon_state = "morgue0"
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.connected.loc
|
||||
//Foreach goto(106)
|
||||
src.connected.icon_state = "morguet"
|
||||
A.loc = connected.loc
|
||||
connected.icon_state = "morguet"
|
||||
else
|
||||
//src.connected = null
|
||||
qdel(src.connected)
|
||||
qdel(connected)
|
||||
connected = null
|
||||
return
|
||||
|
||||
/obj/structure/morgue/Destroy()
|
||||
if(connected)
|
||||
qdel(connected)
|
||||
connected = null
|
||||
return ..()
|
||||
|
||||
|
||||
/*
|
||||
* Morgue tray
|
||||
@@ -155,15 +160,13 @@
|
||||
|
||||
|
||||
/obj/structure/m_tray/attack_hand(mob/user as mob)
|
||||
if (src.connected)
|
||||
for(var/atom/movable/A as mob|obj in src.loc)
|
||||
if (connected)
|
||||
for(var/atom/movable/A as mob|obj in loc)
|
||||
if (!( A.anchored ))
|
||||
A.loc = src.connected
|
||||
//Foreach goto(26)
|
||||
src.connected.connected = null
|
||||
src.connected.update()
|
||||
A.loc = connected
|
||||
connected.connected = null
|
||||
connected.update()
|
||||
add_fingerprint(user)
|
||||
//SN src = null
|
||||
qdel(src)
|
||||
return
|
||||
return
|
||||
@@ -175,13 +178,19 @@
|
||||
return
|
||||
if (!ismob(user) || user.stat || user.lying || user.stunned)
|
||||
return
|
||||
O.loc = src.loc
|
||||
O.loc = loc
|
||||
if (user != O)
|
||||
for(var/mob/B in viewers(user, 3))
|
||||
if ((B.client && !( B.blinded )))
|
||||
B << text("\red [] stuffs [] into []!", user, O, src)
|
||||
return
|
||||
|
||||
/obj/structure/m_tray/Destroy()
|
||||
if(connected && connected.connected == src)
|
||||
connected.connected = null
|
||||
connected = null
|
||||
return ..()
|
||||
|
||||
|
||||
/*
|
||||
* Crematorium
|
||||
@@ -200,116 +209,106 @@
|
||||
var/locked = 0
|
||||
|
||||
/obj/structure/crematorium/proc/update()
|
||||
if (src.connected)
|
||||
src.icon_state = "crema0"
|
||||
if (connected)
|
||||
icon_state = "crema0"
|
||||
else
|
||||
if (src.contents.len)
|
||||
src.icon_state = "crema2"
|
||||
if (contents.len)
|
||||
icon_state = "crema2"
|
||||
else
|
||||
src.icon_state = "crema1"
|
||||
icon_state = "crema1"
|
||||
return
|
||||
|
||||
/obj/structure/crematorium/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
A.loc = loc
|
||||
ex_act(severity)
|
||||
qdel(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
A.loc = loc
|
||||
ex_act(severity)
|
||||
qdel(src)
|
||||
return
|
||||
if(3.0)
|
||||
if (prob(5))
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
A.loc = loc
|
||||
ex_act(severity)
|
||||
qdel(src)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/structure/crematorium/alter_health()
|
||||
return src.loc
|
||||
return loc
|
||||
|
||||
|
||||
/obj/structure/crematorium/attack_hand(mob/user as mob)
|
||||
// if (cremating) AWW MAN! THIS WOULD BE SO MUCH MORE FUN ... TO WATCH
|
||||
// user.show_message("\red Uh-oh, that was a bad idea.", 1)
|
||||
// //usr << "Uh-oh, that was a bad idea."
|
||||
// src:loc:poison += 20000000
|
||||
// src:loc:firelevel = src:loc:poison
|
||||
// return
|
||||
if (cremating)
|
||||
usr << "\red It's locked."
|
||||
return
|
||||
if ((src.connected) && (src.locked == 0))
|
||||
for(var/atom/movable/A as mob|obj in src.connected.loc)
|
||||
if ((connected) && (locked == 0))
|
||||
for(var/atom/movable/A as mob|obj in connected.loc)
|
||||
if (!( A.anchored ))
|
||||
A.loc = src
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
//src.connected = null
|
||||
qdel(src.connected)
|
||||
else if (src.locked == 0)
|
||||
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
src.connected = new /obj/structure/c_tray( src.loc )
|
||||
step(src.connected, SOUTH)
|
||||
src.connected.layer = OBJ_LAYER
|
||||
playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
qdel(connected)
|
||||
connected = null
|
||||
else if (locked == 0)
|
||||
playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
connected = new /obj/structure/c_tray( loc )
|
||||
step(connected, SOUTH)
|
||||
connected.layer = OBJ_LAYER
|
||||
var/turf/T = get_step(src, SOUTH)
|
||||
if (T.contents.Find(src.connected))
|
||||
src.connected.connected = src
|
||||
src.icon_state = "crema0"
|
||||
if (T.contents.Find(connected))
|
||||
connected.connected = src
|
||||
icon_state = "crema0"
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.connected.loc
|
||||
src.connected.icon_state = "cremat"
|
||||
A.loc = connected.loc
|
||||
connected.icon_state = "cremat"
|
||||
else
|
||||
//src.connected = null
|
||||
qdel(src.connected)
|
||||
src.add_fingerprint(user)
|
||||
qdel(connected)
|
||||
connected = null
|
||||
add_fingerprint(user)
|
||||
update()
|
||||
|
||||
/obj/structure/crematorium/attackby(P as obj, mob/user as mob, params)
|
||||
if (istype(P, /obj/item/weapon/pen))
|
||||
var/t = input(user, "What would you like the label to be?", text("[]", src.name), null) as text
|
||||
var/t = input(user, "What would you like the label to be?", text("[]", name), null) as text
|
||||
if (user.get_active_hand() != P)
|
||||
return
|
||||
if ((!in_range(src, usr) > 1 && src.loc != user))
|
||||
if ((!in_range(src, usr) > 1 && loc != user))
|
||||
return
|
||||
t = sanitize(copytext(t,1,MAX_MESSAGE_LEN))
|
||||
if (t)
|
||||
src.name = text("Crematorium- '[]'", t)
|
||||
name = text("Crematorium- '[]'", t)
|
||||
else
|
||||
src.name = "Crematorium"
|
||||
src.add_fingerprint(user)
|
||||
name = "Crematorium"
|
||||
add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/structure/crematorium/relaymove(mob/user as mob)
|
||||
if (user.stat || locked)
|
||||
return
|
||||
src.connected = new /obj/structure/c_tray( src.loc )
|
||||
step(src.connected, SOUTH)
|
||||
src.connected.layer = OBJ_LAYER
|
||||
connected = new /obj/structure/c_tray( loc )
|
||||
step(connected, SOUTH)
|
||||
connected.layer = OBJ_LAYER
|
||||
var/turf/T = get_step(src, SOUTH)
|
||||
if (T.contents.Find(src.connected))
|
||||
src.connected.connected = src
|
||||
src.icon_state = "crema0"
|
||||
if (T.contents.Find(connected))
|
||||
connected.connected = src
|
||||
icon_state = "crema0"
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.connected.loc
|
||||
//Foreach goto(106)
|
||||
src.connected.icon_state = "cremat"
|
||||
A.loc = connected.loc
|
||||
connected.icon_state = "cremat"
|
||||
else
|
||||
//src.connected = null
|
||||
qdel(src.connected)
|
||||
qdel(connected)
|
||||
connected = null
|
||||
return
|
||||
|
||||
/obj/structure/crematorium/proc/cremate(atom/A, mob/user as mob)
|
||||
// for(var/obj/machinery/crema_switch/O in src) //trying to figure a way to call the switch, too drunk to sort it out atm
|
||||
// if(var/on == 1)
|
||||
// return
|
||||
/obj/structure/crematorium/proc/cremate(mob/user as mob)
|
||||
if(cremating)
|
||||
return //don't let you cremate something twice or w/e
|
||||
|
||||
@@ -319,10 +318,10 @@
|
||||
return
|
||||
|
||||
else
|
||||
if(!isemptylist(src.search_contents_for(/obj/item/weapon/disk/nuclear)))
|
||||
if(!isemptylist(search_contents_for(/obj/item/weapon/disk/nuclear)))
|
||||
usr << "You get the feeling that you shouldn't cremate one of the items in the cremator."
|
||||
return
|
||||
if(!isemptylist(src.search_contents_for(/obj/item/flag/nation)))
|
||||
if(!isemptylist(search_contents_for(/obj/item/flag/nation)))
|
||||
usr << "You get the feeling that you shouldn't cremate one of the items in the cremator."
|
||||
return
|
||||
for (var/mob/M in viewers(src))
|
||||
@@ -335,10 +334,10 @@
|
||||
for(var/mob/living/M in contents)
|
||||
if (M.stat!=2)
|
||||
M.emote("scream")
|
||||
//Logging for this causes runtimes resulting in the cremator locking up. Commenting it out until that's figured out.
|
||||
//M.attack_log += "\[[time_stamp()]\] Has been cremated by <b>[user]/[user.ckey]</b>" //No point in this when the mob's about to be deleted
|
||||
//user.attack_log +="\[[time_stamp()]\] Cremated <b>[M]/[M.ckey]</b>"
|
||||
//log_attack("\[[time_stamp()]\] <b>[user]/[user.ckey]</b> cremated <b>[M]/[M.ckey]</b>")
|
||||
if(istype(user))
|
||||
M.attack_log += "\[[time_stamp()]\] Has been cremated by <b>[user]/[user.ckey]</b>"
|
||||
user.attack_log +="\[[time_stamp()]\] Cremated <b>[M]/[M.ckey]</b>"
|
||||
log_attack("\[[time_stamp()]\] <b>[user]/[user.ckey]</b> cremated <b>[M]/[M.ckey]</b>")
|
||||
M.death(1)
|
||||
M.ghostize()
|
||||
qdel(M)
|
||||
@@ -351,9 +350,15 @@
|
||||
cremating = 0
|
||||
locked = 0
|
||||
update()
|
||||
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1)
|
||||
playsound(loc, 'sound/machines/ding.ogg', 50, 1)
|
||||
return
|
||||
|
||||
/obj/structure/crematorium/Destroy()
|
||||
if(connected)
|
||||
qdel(connected)
|
||||
connected = null
|
||||
return ..()
|
||||
|
||||
|
||||
/*
|
||||
* Crematorium tray
|
||||
@@ -370,15 +375,14 @@
|
||||
throwpass = 1
|
||||
|
||||
/obj/structure/c_tray/attack_hand(mob/user as mob)
|
||||
if (src.connected)
|
||||
for(var/atom/movable/A as mob|obj in src.loc)
|
||||
if (connected)
|
||||
for(var/atom/movable/A as mob|obj in loc)
|
||||
if (!( A.anchored ))
|
||||
A.loc = src.connected
|
||||
A.loc = connected
|
||||
//Foreach goto(26)
|
||||
src.connected.connected = null
|
||||
src.connected.update()
|
||||
connected.connected = null
|
||||
connected.update()
|
||||
add_fingerprint(user)
|
||||
//SN src = null
|
||||
qdel(src)
|
||||
return
|
||||
return
|
||||
@@ -390,7 +394,7 @@
|
||||
return
|
||||
if (!ismob(user) || user.stat || user.lying || user.stunned)
|
||||
return
|
||||
O.loc = src.loc
|
||||
O.loc = loc
|
||||
if (user != O)
|
||||
for(var/mob/B in viewers(user, 3))
|
||||
if ((B.client && !( B.blinded )))
|
||||
@@ -398,8 +402,14 @@
|
||||
//Foreach goto(99)
|
||||
return
|
||||
|
||||
/obj/structure/m_tray/Destroy()
|
||||
if(connected && connected.connected == src)
|
||||
connected.connected = null
|
||||
connected = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/crema_switch/attack_hand(mob/user as mob)
|
||||
if(src.allowed(usr))
|
||||
if(allowed(usr))
|
||||
for (var/obj/structure/crematorium/C in world)
|
||||
if (C.id == id)
|
||||
if (!C.cremating)
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
icon = 'icons/obj/objects.dmi'
|
||||
icon_state = "stool"
|
||||
anchored = 1.0
|
||||
pressure_resistance = 15
|
||||
|
||||
/obj/structure/stool/ex_act(severity)
|
||||
switch(severity)
|
||||
|
||||
@@ -75,6 +75,17 @@ var/global/normal_ooc_colour = "#002eb8"
|
||||
C << "<font color='[normal_ooc_colour]'><span class='ooc'><span class='prefix'>OOC:</span> <EM>[src.key]:</EM> <span class='message'>[msg]</span></span></font>"
|
||||
*/
|
||||
|
||||
/proc/toggle_ooc()
|
||||
ooc_allowed = !( ooc_allowed )
|
||||
if (ooc_allowed)
|
||||
world << "<B>The OOC channel has been globally enabled!</B>"
|
||||
else
|
||||
world << "<B>The OOC channel has been globally disabled!</B>"
|
||||
|
||||
/proc/auto_toggle_ooc(var/on)
|
||||
if(config.auto_toggle_ooc_during_round && ooc_allowed != on)
|
||||
toggle_ooc()
|
||||
|
||||
/client/proc/set_ooc(newColor as color)
|
||||
set name = "Set Player OOC Colour"
|
||||
set desc = "Set to yellow for eye burning goodness."
|
||||
|
||||
@@ -629,11 +629,7 @@ var/global/nologevent = 0
|
||||
set category = "Server"
|
||||
set desc="Globally Toggles OOC"
|
||||
set name="Toggle OOC"
|
||||
ooc_allowed = !( ooc_allowed )
|
||||
if (ooc_allowed)
|
||||
world << "<B>The OOC channel has been globally enabled!</B>"
|
||||
else
|
||||
world << "<B>The OOC channel has been globally disabled!</B>"
|
||||
toggle_ooc()
|
||||
log_admin("[key_name(usr)] toggled OOC.")
|
||||
message_admins("[key_name_admin(usr)] toggled OOC.", 1)
|
||||
feedback_add_details("admin_verb","TOOC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
@@ -126,7 +126,7 @@ datum/admins/proc/notes_gethtml(var/ckey)
|
||||
message_admins("\blue [key_name_admin(usr)] has edited [key]'s notes.")
|
||||
log_admin("[key_name(usr)] has edited [key]'s notes.")
|
||||
|
||||
del info
|
||||
del(info)
|
||||
|
||||
//Updating list of keys with notes on them
|
||||
var/savefile/note_list = new("data/player_notes.sav")
|
||||
@@ -135,7 +135,7 @@ datum/admins/proc/notes_gethtml(var/ckey)
|
||||
if(!note_keys) note_keys = list()
|
||||
if(!note_keys.Find(key)) note_keys += key
|
||||
note_list << note_keys
|
||||
del note_list
|
||||
del(note_list)
|
||||
|
||||
|
||||
/proc/notes_del(var/key, var/index)
|
||||
@@ -151,7 +151,7 @@ datum/admins/proc/notes_gethtml(var/ckey)
|
||||
message_admins("\blue [key_name_admin(usr)] deleted one of [key]'s notes.")
|
||||
log_admin("[key_name(usr)] deleted one of [key]'s notes.")
|
||||
|
||||
del info
|
||||
del(info)
|
||||
|
||||
/proc/show_player_info_irc(var/key as text)
|
||||
var/dat = " Info on [key]%0D%0A"
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
return
|
||||
|
||||
message_admins("[key_name_admin(src)] accessed file: [path]")
|
||||
src << run( file(path) )
|
||||
src << ftp( file(path) )
|
||||
src << "Attempting to send file, this may take a fair few minutes if the file is very large."
|
||||
return
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
return
|
||||
|
||||
message_admins("[key_name_admin(src)] accessed file: [path]")
|
||||
src << run( file(path) )
|
||||
src << ftp( file(path) )
|
||||
src << "Attempting to send file, this may take a fair few minutes if the file is very large."
|
||||
return
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
|
||||
var/path = "data/logs/[time2text(world.realtime,"YYYY/MM-Month/DD-Day")].log"
|
||||
if( fexists(path) )
|
||||
src << run( file(path) )
|
||||
src << ftp( file(path) )
|
||||
else
|
||||
src << "<font color='red'>Error: view_txt_log(): File not found/Invalid path([path]).</font>"
|
||||
return
|
||||
@@ -102,7 +102,7 @@
|
||||
|
||||
var/path = "data/logs/[time2text(world.realtime,"YYYY/MM-Month/DD-Day")] Attack.log"
|
||||
if( fexists(path) )
|
||||
src << run( file(path) )
|
||||
src << ftp( file(path) )
|
||||
else
|
||||
src << "<font color='red'>Error: view_atk_log(): File not found/Invalid path([path]).</font>"
|
||||
return
|
||||
|
||||
@@ -367,7 +367,7 @@ client/proc/one_click_antag()
|
||||
candidates.Remove(theghost)
|
||||
|
||||
if(!theghost)
|
||||
del(new_syndicate_commando)
|
||||
qdel(new_syndicate_commando)
|
||||
break
|
||||
|
||||
new_syndicate_commando.key = theghost.key
|
||||
@@ -487,7 +487,7 @@ client/proc/one_click_antag()
|
||||
candidates.Remove(theghost)
|
||||
|
||||
if(!theghost)
|
||||
del(new_vox)
|
||||
qdel(new_vox)
|
||||
break
|
||||
|
||||
new_vox.key = theghost.key
|
||||
|
||||
@@ -443,16 +443,16 @@ Gunshots/explosions/opening doors/less rare audio (done)
|
||||
/obj/effect/fake_attacker/proc/updateimage()
|
||||
// del src.currentimage
|
||||
if(src.dir == NORTH)
|
||||
del src.currentimage
|
||||
del(src.currentimage)
|
||||
src.currentimage = new /image(up,src)
|
||||
else if(src.dir == SOUTH)
|
||||
del src.currentimage
|
||||
del(src.currentimage)
|
||||
src.currentimage = new /image(down,src)
|
||||
else if(src.dir == EAST)
|
||||
del src.currentimage
|
||||
del(src.currentimage)
|
||||
src.currentimage = new /image(right,src)
|
||||
else if(src.dir == WEST)
|
||||
del src.currentimage
|
||||
del(src.currentimage)
|
||||
src.currentimage = new /image(left,src)
|
||||
my_target << currentimage
|
||||
|
||||
|
||||
@@ -1,24 +1,16 @@
|
||||
|
||||
/obj/machinery/candy_maker
|
||||
/obj/machinery/kitchen_machine/candy_maker
|
||||
name = "candy machine"
|
||||
desc = "The stuff of nightmares for a dentist."
|
||||
icon = 'icons/obj/cooking_machines.dmi'
|
||||
icon_state = "candymaker_off"
|
||||
layer = 2.9
|
||||
density = 1
|
||||
anchored = 1
|
||||
use_power = 1
|
||||
idle_power_usage = 5
|
||||
active_power_usage = 100
|
||||
flags = OPENCONTAINER | NOREACT
|
||||
var/operating = 0 // Is it on?
|
||||
var/dirty = 0 // = {0..100} Does it need cleaning?
|
||||
var/broken = 0 // ={0,1,2} How broken is it???
|
||||
var/global/list/datum/recipe/available_recipes // List of the recipes you can use
|
||||
var/global/list/acceptable_items // List of the items you can put in
|
||||
var/global/list/acceptable_reagents // List of the reagents you can put in
|
||||
var/global/max_n_of_items = 0
|
||||
var/efficiency
|
||||
cook_verbs = list("Wonderizing", "Scrumpdiddlyumptiousification", "Miracle-coating", "Flavorifaction")
|
||||
recipe_type = /datum/recipe/candy
|
||||
off_icon = "candymaker_off"
|
||||
on_icon = "candymaker_on"
|
||||
broken_icon = "candymaker_broke"
|
||||
dirty_icon = "candymaker_dirty"
|
||||
open_icon = "candymaker_open"
|
||||
|
||||
// see code/modules/food/recipes_candy.dm for recipes
|
||||
|
||||
@@ -26,29 +18,8 @@
|
||||
* Initialising
|
||||
********************/
|
||||
|
||||
/obj/machinery/candy_maker/New()
|
||||
//..() //do not need this
|
||||
reagents = new/datum/reagents(100)
|
||||
reagents.my_atom = src
|
||||
if (!available_recipes)
|
||||
available_recipes = new
|
||||
for (var/type in (typesof(/datum/recipe/candy)-/datum/recipe/candy))
|
||||
var/datum/recipe/recipe = new type
|
||||
if(recipe.result) // Ignore recipe subtypes that lack a result
|
||||
available_recipes += recipe
|
||||
else
|
||||
qdel(recipe)
|
||||
acceptable_items = new
|
||||
acceptable_reagents = new
|
||||
for (var/datum/recipe/candy/recipe in available_recipes)
|
||||
for (var/item in recipe.items)
|
||||
acceptable_items |= item
|
||||
for (var/reagent in recipe.reagents)
|
||||
acceptable_reagents |= reagent
|
||||
if (recipe.items)
|
||||
max_n_of_items = max(max_n_of_items,recipe.items.len)
|
||||
acceptable_items |= /obj/item/weapon/reagent_containers/food/snacks/grown
|
||||
|
||||
/obj/machinery/kitchen_machine/candy_maker/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/candy_maker(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/manipulator(null)
|
||||
@@ -56,8 +27,7 @@
|
||||
component_parts += new /obj/item/stack/cable_coil(null, 5)
|
||||
RefreshParts()
|
||||
|
||||
|
||||
/obj/machinery/candy_maker/upgraded/New()
|
||||
/obj/machinery/kitchen_machine/candy_maker/upgraded/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/candy_maker(null)
|
||||
@@ -66,363 +36,8 @@
|
||||
component_parts += new /obj/item/stack/cable_coil(null, 5)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/candy_maker/RefreshParts()
|
||||
/obj/machinery/kitchen_machine/candy_maker/RefreshParts()
|
||||
var/E
|
||||
for(var/obj/item/weapon/stock_parts/manipulator/M in component_parts)
|
||||
E += M.rating
|
||||
efficiency = E
|
||||
|
||||
/*******************
|
||||
* Item Adding
|
||||
********************/
|
||||
|
||||
/obj/machinery/candy_maker/attackby(var/obj/item/O as obj, var/mob/user as mob, params)
|
||||
if(operating)
|
||||
return
|
||||
if(!broken && dirty < 100)
|
||||
if(default_deconstruction_screwdriver(user, "candymaker_open", "candymaker_off", O))
|
||||
return
|
||||
if(exchange_parts(user, O))
|
||||
return
|
||||
if(!broken && istype(O, /obj/item/weapon/wrench))
|
||||
playsound(src, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
if(anchored)
|
||||
anchored = 0
|
||||
user << "<span class='caution'>The [src] can now be moved.</span>"
|
||||
return
|
||||
else if(!anchored)
|
||||
anchored = 1
|
||||
user << "<span class='caution'>The [src] is now secured.</span>"
|
||||
return
|
||||
|
||||
default_deconstruction_crowbar(O)
|
||||
|
||||
if(src.broken > 0)
|
||||
if(src.broken == 2 && istype(O, /obj/item/weapon/screwdriver)) // If it's broken and they're using a screwdriver
|
||||
user.visible_message( \
|
||||
"\blue [user] starts to fix part of the candy maker.", \
|
||||
"\blue You start to fix part of the candy maker." \
|
||||
)
|
||||
if (do_after(user,20))
|
||||
user.visible_message( \
|
||||
"\blue [user] fixes part of the candy maker.", \
|
||||
"\blue You have fixed part of the candy maker." \
|
||||
)
|
||||
src.broken = 1 // Fix it a bit
|
||||
else if(src.broken == 1 && istype(O, /obj/item/weapon/wrench)) // If it's broken and they're doing the wrench
|
||||
user.visible_message( \
|
||||
"\blue [user] starts to fix part of the candy maker.", \
|
||||
"\blue You start to fix part of the candy maker." \
|
||||
)
|
||||
if (do_after(user,20))
|
||||
user.visible_message( \
|
||||
"\blue [user] fixes the candy maker.", \
|
||||
"\blue You have fixed the candy maker." \
|
||||
)
|
||||
src.icon_state = "candymaker_off"
|
||||
src.broken = 0 // Fix it!
|
||||
src.dirty = 0 // just to be sure
|
||||
src.flags = OPENCONTAINER
|
||||
else
|
||||
user << "\red It's broken!"
|
||||
return 1
|
||||
else if(src.dirty==100) // The candy_maker is all dirty so can't be used!
|
||||
if(istype(O, /obj/item/weapon/reagent_containers/spray/cleaner) || istype(O, /obj/item/weapon/soap)) // If they're trying to clean it then let them
|
||||
user.visible_message( \
|
||||
"\blue [user] starts to clean the candy maker.", \
|
||||
"\blue You start to clean the candy maker." \
|
||||
)
|
||||
if (do_after(user,20))
|
||||
user.visible_message( \
|
||||
"\blue [user] has cleaned the candy maker.", \
|
||||
"\blue You have cleaned the candy maker." \
|
||||
)
|
||||
src.dirty = 0 // It's clean!
|
||||
src.broken = 0 // just to be sure
|
||||
src.icon_state = "candymaker_off"
|
||||
src.flags = OPENCONTAINER
|
||||
else //Otherwise bad luck!!
|
||||
user << "\red It's dirty!"
|
||||
return 1
|
||||
else if(is_type_in_list(O,acceptable_items))
|
||||
if (contents.len>=max_n_of_items)
|
||||
user << "\red This [src] is full of ingredients, you cannot put more."
|
||||
return 1
|
||||
if (istype(O,/obj/item/stack) && O:amount>1)
|
||||
new O.type (src)
|
||||
O:use(1)
|
||||
user.visible_message( \
|
||||
"\blue [user] has added one of [O] to \the [src].", \
|
||||
"\blue You add one of [O] to \the [src].")
|
||||
else
|
||||
// user.unEquip(O) //This just causes problems so far as I can tell. -Pete
|
||||
if(!user.drop_item())
|
||||
user << "<span class='notice'>\the [O] is stuck to your hand, you cannot put it in \the [src]</span>"
|
||||
return 0
|
||||
O.loc = src
|
||||
user.visible_message( \
|
||||
"\blue [user] has added \the [O] to \the [src].", \
|
||||
"\blue You add \the [O] to \the [src].")
|
||||
else if(istype(O,/obj/item/weapon/reagent_containers/glass) || \
|
||||
istype(O,/obj/item/weapon/reagent_containers/food/drinks) || \
|
||||
istype(O,/obj/item/weapon/reagent_containers/food/condiment) \
|
||||
)
|
||||
if (!O.reagents)
|
||||
return 1
|
||||
for (var/datum/reagent/R in O.reagents.reagent_list)
|
||||
if (!(R.id in acceptable_reagents))
|
||||
user << "\red Your [O] contains components unsuitable for cookery."
|
||||
return 1
|
||||
//G.reagents.trans_to(src,G.amount_per_transfer_from_this)
|
||||
else if(istype(O,/obj/item/weapon/grab))
|
||||
var/obj/item/weapon/grab/G = O
|
||||
user << "\red This is ridiculous. You can not fit \the [G.affecting] in this [src]."
|
||||
return 1
|
||||
else
|
||||
user << "\red You have no idea what you can cook with this [O]."
|
||||
return 1
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/candy_maker/attack_ai(mob/user as mob)
|
||||
return 0
|
||||
|
||||
/obj/machinery/candy_maker/attack_hand(mob/user as mob)
|
||||
user.set_machine(src)
|
||||
interact(user)
|
||||
|
||||
/*******************
|
||||
* candy_maker Menu
|
||||
********************/
|
||||
|
||||
/obj/machinery/candy_maker/interact(mob/user as mob) // The Candy Maker Menu
|
||||
if(panel_open || !anchored)
|
||||
return
|
||||
var/dat = ""
|
||||
if(src.broken > 0)
|
||||
dat = {"<TT>Bzzzzttttt</TT>"}
|
||||
else if(src.operating)
|
||||
var/whimsy_word = pick("Wonderizing", "Scrumpdiddlyumptiousification", "Miracle-coating", "Flavorifaction")
|
||||
dat = {"<TT>[whimsy_word] in progress!<BR>Please wait...!</TT>"}
|
||||
else if(src.dirty==100)
|
||||
dat = {"<TT>This candy maker is dirty!<BR>Please clean it before use!</TT>"}
|
||||
else
|
||||
var/list/items_counts = new
|
||||
var/list/items_measures = new
|
||||
var/list/items_measures_p = new
|
||||
for (var/obj/O in contents)
|
||||
var/display_name = O.name
|
||||
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/egg))
|
||||
items_measures[display_name] = "egg"
|
||||
items_measures_p[display_name] = "eggs"
|
||||
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/tofu))
|
||||
items_measures[display_name] = "tofu chunk"
|
||||
items_measures_p[display_name] = "tofu chunks"
|
||||
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/meat)) //any meat
|
||||
items_measures[display_name] = "slab of meat"
|
||||
items_measures_p[display_name] = "slabs of meat"
|
||||
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/donkpocket))
|
||||
display_name = "Turnovers"
|
||||
items_measures[display_name] = "turnover"
|
||||
items_measures_p[display_name] = "turnovers"
|
||||
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/carpmeat))
|
||||
items_measures[display_name] = "fillet of meat"
|
||||
items_measures_p[display_name] = "fillets of meat"
|
||||
items_counts[display_name]++
|
||||
for (var/O in items_counts)
|
||||
var/N = items_counts[O]
|
||||
if (!(O in items_measures))
|
||||
dat += {"<B>[capitalize(O)]:</B> [N] [lowertext(O)]\s<BR>"}
|
||||
else
|
||||
if (N==1)
|
||||
dat += {"<B>[capitalize(O)]:</B> [N] [items_measures[O]]<BR>"}
|
||||
else
|
||||
dat += {"<B>[capitalize(O)]:</B> [N] [items_measures_p[O]]<BR>"}
|
||||
|
||||
for (var/datum/reagent/R in reagents.reagent_list)
|
||||
var/display_name = R.name
|
||||
if (R.id == "capsaicin")
|
||||
display_name = "Hotsauce"
|
||||
if (R.id == "frostoil")
|
||||
display_name = "Coldsauce"
|
||||
dat += {"<B>[display_name]:</B> [R.volume] unit\s<BR>"}
|
||||
|
||||
if (items_counts.len==0 && reagents.reagent_list.len==0)
|
||||
dat = {"<B>The candy maker is empty</B><BR>"}
|
||||
else
|
||||
dat = {"<b>Ingredients:</b><br>[dat]"}
|
||||
dat += {"<HR><BR>\
|
||||
<A href='?src=\ref[src];action=cook'>Turn on!<BR>\
|
||||
<A href='?src=\ref[src];action=dispose'>Eject ingredients!<BR>\
|
||||
"}
|
||||
|
||||
user << browse("<HEAD><TITLE>Candy Maker Controls</TITLE></HEAD><TT>[dat]</TT>", "window=candy_maker")
|
||||
onclose(user, "candy_maker")
|
||||
return
|
||||
|
||||
|
||||
|
||||
/***********************************
|
||||
* candy_maker Menu Handling/Cooking
|
||||
************************************/
|
||||
|
||||
/obj/machinery/candy_maker/proc/cook()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
start()
|
||||
if (reagents.total_volume==0 && !(locate(/obj) in contents)) //dry run
|
||||
if (!wzhzhzh(10))
|
||||
abort()
|
||||
return
|
||||
stop()
|
||||
return
|
||||
|
||||
var/datum/recipe/recipe = select_recipe(available_recipes,src)
|
||||
var/obj/cooked
|
||||
var/obj/byproduct
|
||||
if (!recipe)
|
||||
dirty += 1
|
||||
if (prob(max(10,dirty*5)))
|
||||
if (!wzhzhzh(4))
|
||||
abort()
|
||||
return
|
||||
muck_start()
|
||||
wzhzhzh(4)
|
||||
muck_finish()
|
||||
cooked = fail()
|
||||
cooked.loc = src.loc
|
||||
return
|
||||
else if (has_extra_item())
|
||||
if (!wzhzhzh(4))
|
||||
abort()
|
||||
return
|
||||
broke()
|
||||
cooked = fail()
|
||||
cooked.loc = src.loc
|
||||
return
|
||||
else
|
||||
if (!wzhzhzh(10))
|
||||
abort()
|
||||
return
|
||||
stop()
|
||||
cooked = fail()
|
||||
cooked.loc = src.loc
|
||||
return
|
||||
else
|
||||
var/halftime = round(recipe.time/10/2)
|
||||
if (!wzhzhzh(halftime))
|
||||
abort()
|
||||
return
|
||||
if (!wzhzhzh(halftime))
|
||||
abort()
|
||||
cooked = fail()
|
||||
cooked.loc = src.loc
|
||||
return
|
||||
cooked = recipe.make_food(src)
|
||||
byproduct = recipe.get_byproduct()
|
||||
stop()
|
||||
if(cooked)
|
||||
cooked.loc = src.loc
|
||||
for(var/i=1,i<efficiency,i++)
|
||||
cooked = new cooked.type(loc)
|
||||
if(byproduct)
|
||||
new byproduct(loc)
|
||||
return
|
||||
|
||||
/obj/machinery/candy_maker/proc/wzhzhzh(var/seconds as num)
|
||||
for (var/i=1 to seconds)
|
||||
if (stat & (NOPOWER|BROKEN))
|
||||
return 0
|
||||
use_power(500)
|
||||
sleep(10)
|
||||
return 1
|
||||
|
||||
/obj/machinery/candy_maker/proc/has_extra_item()
|
||||
for (var/obj/O in contents)
|
||||
if ( \
|
||||
!istype(O,/obj/item/weapon/reagent_containers/food) && \
|
||||
!istype(O, /obj/item/weapon/grown) \
|
||||
)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/candy_maker/proc/start()
|
||||
src.visible_message("\blue The candy maker turns on.", "\blue You hear a candy maker.")
|
||||
src.operating = 1
|
||||
src.icon_state = "candymaker_on"
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/candy_maker/proc/abort()
|
||||
src.operating = 0 // Turn it off again aferwards
|
||||
src.icon_state = "candymaker_off"
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/candy_maker/proc/stop()
|
||||
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1)
|
||||
src.operating = 0 // Turn it off again aferwards
|
||||
src.icon_state = "candymaker_off"
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/candy_maker/proc/dispose()
|
||||
for (var/obj/O in contents)
|
||||
O.loc = src.loc
|
||||
if (src.reagents.total_volume)
|
||||
src.dirty++
|
||||
src.reagents.clear_reagents()
|
||||
usr << "\blue You dispose of the candy maker contents."
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/candy_maker/proc/muck_start()
|
||||
playsound(src.loc, 'sound/effects/splat.ogg', 50, 1) // Play a splat sound
|
||||
src.icon_state = "candymaker_dirty" // Make it look dirty!!
|
||||
|
||||
/obj/machinery/candy_maker/proc/muck_finish()
|
||||
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1)
|
||||
src.visible_message("\red The candy maker gets covered in muck!")
|
||||
src.dirty = 100 // Make it dirty so it can't be used util cleaned
|
||||
src.flags = null //So you can't add condiments
|
||||
src.icon_state = "candymaker_dirty" // Make it look dirty too
|
||||
src.operating = 0 // Turn it off again aferwards
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/candy_maker/proc/broke()
|
||||
var/datum/effect/effect/system/spark_spread/s = new
|
||||
s.set_up(2, 1, src)
|
||||
s.start()
|
||||
src.icon_state = "candymaker_broke" // Make it look all busted up and shit
|
||||
src.visible_message("\red The candy maker breaks!") //Let them know they're stupid
|
||||
src.broken = 2 // Make it broken so it can't be used util fixed
|
||||
src.flags = null //So you can't add condiments
|
||||
src.operating = 0 // Turn it off again aferwards
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/candy_maker/proc/fail()
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/badrecipe/ffuu = new(src)
|
||||
var/amount = 0
|
||||
for (var/obj/O in contents-ffuu)
|
||||
amount++
|
||||
if (O.reagents)
|
||||
var/id = O.reagents.get_master_reagent_id()
|
||||
if (id)
|
||||
amount+=O.reagents.get_reagent_amount(id)
|
||||
qdel(O)
|
||||
src.reagents.clear_reagents()
|
||||
ffuu.reagents.add_reagent("carbon", amount)
|
||||
ffuu.reagents.add_reagent("????", amount/10)
|
||||
return ffuu
|
||||
|
||||
/obj/machinery/candy_maker/Topic(href, href_list)
|
||||
if(..() || panel_open)
|
||||
return
|
||||
|
||||
usr.set_machine(src)
|
||||
if(src.operating)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
switch(href_list["action"])
|
||||
if ("cook")
|
||||
cook()
|
||||
|
||||
if ("dispose")
|
||||
dispose()
|
||||
return
|
||||
|
||||
+12
-393
@@ -1,25 +1,16 @@
|
||||
|
||||
/obj/machinery/grill
|
||||
/obj/machinery/kitchen_machine/grill
|
||||
name = "grill"
|
||||
desc = "Backyard grilling, IN SPACE."
|
||||
icon = 'icons/obj/cooking_machines.dmi'
|
||||
icon_state = "grill_off"
|
||||
layer = 2.9
|
||||
density = 1
|
||||
anchored = 1
|
||||
use_power = 1
|
||||
idle_power_usage = 5
|
||||
active_power_usage = 100
|
||||
flags = OPENCONTAINER | NOREACT
|
||||
var/operating = 0 // Is it on?
|
||||
var/dirty = 0 // = {0..100} Does it need cleaning?
|
||||
var/broken = 0 // ={0,1,2} How broken is it???
|
||||
var/global/list/datum/recipe/available_recipes // List of the recipes you can use
|
||||
var/global/list/acceptable_items // List of the items you can put in
|
||||
var/global/list/acceptable_reagents // List of the reagents you can put in
|
||||
var/global/max_n_of_items = 0
|
||||
var/efficiency
|
||||
|
||||
cook_verbs = list("Grilling", "Searing", "Frying")
|
||||
recipe_type = /datum/recipe/grill
|
||||
off_icon = "grill_off"
|
||||
on_icon = "grill_on"
|
||||
broken_icon = "grill_broke"
|
||||
dirty_icon = "grill_dirty"
|
||||
open_icon = "grill_open"
|
||||
|
||||
// see code/modules/food/recipes_grill.dm for recipes
|
||||
|
||||
@@ -27,29 +18,8 @@
|
||||
* Initialising
|
||||
********************/
|
||||
|
||||
/obj/machinery/grill/New()
|
||||
//..() //do not need this
|
||||
reagents = new/datum/reagents(100)
|
||||
reagents.my_atom = src
|
||||
if (!available_recipes)
|
||||
available_recipes = new
|
||||
for (var/type in (typesof(/datum/recipe/grill)-/datum/recipe/grill))
|
||||
var/datum/recipe/recipe = new type
|
||||
if(recipe.result) // Ignore recipe subtypes that lack a result
|
||||
available_recipes += recipe
|
||||
else
|
||||
qdel(recipe)
|
||||
acceptable_items = new
|
||||
acceptable_reagents = new
|
||||
for (var/datum/recipe/grill/recipe in available_recipes)
|
||||
for (var/item in recipe.items)
|
||||
acceptable_items |= item
|
||||
for (var/reagent in recipe.reagents)
|
||||
acceptable_reagents |= reagent
|
||||
if (recipe.items)
|
||||
max_n_of_items = max(max_n_of_items,recipe.items.len)
|
||||
acceptable_items |= /obj/item/weapon/reagent_containers/food/snacks/grown
|
||||
|
||||
/obj/machinery/kitchen_machine/grill/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/grill(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/micro_laser(null)
|
||||
@@ -58,8 +28,7 @@
|
||||
component_parts += new /obj/item/stack/cable_coil(null, 5)
|
||||
RefreshParts()
|
||||
|
||||
|
||||
/obj/machinery/grill/upgraded/New()
|
||||
/obj/machinery/kitchen_machine/grill/upgraded/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/grill(null)
|
||||
@@ -69,358 +38,8 @@
|
||||
component_parts += new /obj/item/stack/cable_coil(null, 5)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/grill/RefreshParts()
|
||||
/obj/machinery/kitchen_machine/grill/RefreshParts()
|
||||
var/E
|
||||
for(var/obj/item/weapon/stock_parts/micro_laser/M in component_parts)
|
||||
E += M.rating
|
||||
efficiency = round((E/2), 1) // There's 2 lasers, so halve the effect on the efficiency to keep it balanced
|
||||
|
||||
/*******************
|
||||
* Item Adding
|
||||
********************/
|
||||
|
||||
/obj/machinery/grill/attackby(var/obj/item/O as obj, var/mob/user as mob, params)
|
||||
if(operating)
|
||||
return
|
||||
if(!broken && dirty < 100)
|
||||
if(default_deconstruction_screwdriver(user, "grill_open", "grill_off", O))
|
||||
return
|
||||
if(exchange_parts(user, O))
|
||||
return
|
||||
if(!broken && istype(O, /obj/item/weapon/wrench))
|
||||
playsound(src, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
if(anchored)
|
||||
anchored = 0
|
||||
user << "<span class='caution'>The [src] can now be moved.</span>"
|
||||
return
|
||||
else if(!anchored)
|
||||
anchored = 1
|
||||
user << "<span class='caution'>The [src] is now secured.</span>"
|
||||
return
|
||||
|
||||
default_deconstruction_crowbar(O)
|
||||
|
||||
if(src.broken > 0)
|
||||
if(src.broken == 2 && istype(O, /obj/item/weapon/screwdriver)) // If it's broken and they're using a screwdriver
|
||||
user.visible_message( \
|
||||
"\blue [user] starts to fix part of the grill.", \
|
||||
"\blue You start to fix part of the grill." \
|
||||
)
|
||||
if (do_after(user,20))
|
||||
user.visible_message( \
|
||||
"\blue [user] fixes part of the grill.", \
|
||||
"\blue You have fixed part of the grill." \
|
||||
)
|
||||
src.broken = 1 // Fix it a bit
|
||||
else if(src.broken == 1 && istype(O, /obj/item/weapon/wrench)) // If it's broken and they're doing the wrench
|
||||
user.visible_message( \
|
||||
"\blue [user] starts to fix part of the grill.", \
|
||||
"\blue You start to fix part of the grill." \
|
||||
)
|
||||
if (do_after(user,20))
|
||||
user.visible_message( \
|
||||
"\blue [user] fixes the grill.", \
|
||||
"\blue You have fixed the grill." \
|
||||
)
|
||||
src.icon_state = "grill_off"
|
||||
src.broken = 0 // Fix it!
|
||||
src.dirty = 0 // just to be sure
|
||||
src.flags = OPENCONTAINER
|
||||
else
|
||||
user << "\red It's broken!"
|
||||
return 1
|
||||
else if(src.dirty==100) // The grill is all dirty so can't be used!
|
||||
if(istype(O, /obj/item/weapon/reagent_containers/spray/cleaner) || istype(O, /obj/item/weapon/soap)) // If they're trying to clean it then let them
|
||||
user.visible_message( \
|
||||
"\blue [user] starts to clean the grill.", \
|
||||
"\blue You start to clean the grill." \
|
||||
)
|
||||
if (do_after(user,20))
|
||||
user.visible_message( \
|
||||
"\blue [user] has cleaned the grill.", \
|
||||
"\blue You have cleaned the grill." \
|
||||
)
|
||||
src.dirty = 0 // It's clean!
|
||||
src.broken = 0 // just to be sure
|
||||
src.icon_state = "grill_off"
|
||||
src.flags = OPENCONTAINER
|
||||
else //Otherwise bad luck!!
|
||||
user << "\red It's dirty!"
|
||||
return 1
|
||||
else if(is_type_in_list(O,acceptable_items))
|
||||
if (contents.len>=max_n_of_items)
|
||||
user << "\red This [src] is full of ingredients, you cannot put more."
|
||||
return 1
|
||||
if (istype(O,/obj/item/stack) && O:amount>1)
|
||||
new O.type (src)
|
||||
O:use(1)
|
||||
user.visible_message( \
|
||||
"\blue [user] has added one of [O] to \the [src].", \
|
||||
"\blue You add one of [O] to \the [src].")
|
||||
else
|
||||
// user.unEquip(O) //This just causes problems so far as I can tell. -Pete
|
||||
if(!user.drop_item())
|
||||
user << "<span class='notice'>\the [O] is stuck to your hand, you cannot put it in \the [src]</span>"
|
||||
return 0
|
||||
O.loc = src
|
||||
user.visible_message( \
|
||||
"\blue [user] has added \the [O] to \the [src].", \
|
||||
"\blue You add \the [O] to \the [src].")
|
||||
else if(istype(O,/obj/item/weapon/reagent_containers/glass) || \
|
||||
istype(O,/obj/item/weapon/reagent_containers/food/drinks) || \
|
||||
istype(O,/obj/item/weapon/reagent_containers/food/condiment) \
|
||||
)
|
||||
if (!O.reagents)
|
||||
return 1
|
||||
for (var/datum/reagent/R in O.reagents.reagent_list)
|
||||
if (!(R.id in acceptable_reagents))
|
||||
user << "\red Your [O] contains components unsuitable for cookery."
|
||||
return 1
|
||||
//G.reagents.trans_to(src,G.amount_per_transfer_from_this)
|
||||
else if(istype(O,/obj/item/weapon/grab))
|
||||
var/obj/item/weapon/grab/G = O
|
||||
user << "\red This is ridiculous. You can not fit \the [G.affecting] in this [src]."
|
||||
return 1
|
||||
else
|
||||
user << "\red You have no idea what you can cook with this [O]."
|
||||
return 1
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/grill/attack_ai(mob/user as mob)
|
||||
return 0
|
||||
|
||||
/obj/machinery/grill/attack_hand(mob/user as mob)
|
||||
user.set_machine(src)
|
||||
interact(user)
|
||||
|
||||
/*******************
|
||||
* grill Menu
|
||||
********************/
|
||||
|
||||
/obj/machinery/grill/interact(mob/user as mob) // The grill Menu
|
||||
if(panel_open || !anchored)
|
||||
return
|
||||
var/dat = ""
|
||||
if(src.broken > 0)
|
||||
dat = {"<TT>Bzzzzttttt</TT>"}
|
||||
else if(src.operating)
|
||||
dat = {"<TT>Grilling in progress!<BR>Please wait...!</TT>"}
|
||||
else if(src.dirty==100)
|
||||
dat = {"<TT>This grill is dirty!<BR>Please clean it before use!</TT>"}
|
||||
else
|
||||
var/list/items_counts = new
|
||||
var/list/items_measures = new
|
||||
var/list/items_measures_p = new
|
||||
for (var/obj/O in contents)
|
||||
var/display_name = O.name
|
||||
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/egg))
|
||||
items_measures[display_name] = "egg"
|
||||
items_measures_p[display_name] = "eggs"
|
||||
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/tofu))
|
||||
items_measures[display_name] = "tofu chunk"
|
||||
items_measures_p[display_name] = "tofu chunks"
|
||||
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/meat)) //any meat
|
||||
items_measures[display_name] = "slab of meat"
|
||||
items_measures_p[display_name] = "slabs of meat"
|
||||
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/donkpocket))
|
||||
display_name = "Turnovers"
|
||||
items_measures[display_name] = "turnover"
|
||||
items_measures_p[display_name] = "turnovers"
|
||||
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/carpmeat))
|
||||
items_measures[display_name] = "fillet of meat"
|
||||
items_measures_p[display_name] = "fillets of meat"
|
||||
items_counts[display_name]++
|
||||
for (var/O in items_counts)
|
||||
var/N = items_counts[O]
|
||||
if (!(O in items_measures))
|
||||
dat += {"<B>[capitalize(O)]:</B> [N] [lowertext(O)]\s<BR>"}
|
||||
else
|
||||
if (N==1)
|
||||
dat += {"<B>[capitalize(O)]:</B> [N] [items_measures[O]]<BR>"}
|
||||
else
|
||||
dat += {"<B>[capitalize(O)]:</B> [N] [items_measures_p[O]]<BR>"}
|
||||
|
||||
for (var/datum/reagent/R in reagents.reagent_list)
|
||||
var/display_name = R.name
|
||||
if (R.id == "capsaicin")
|
||||
display_name = "Hotsauce"
|
||||
if (R.id == "frostoil")
|
||||
display_name = "Coldsauce"
|
||||
dat += {"<B>[display_name]:</B> [R.volume] unit\s<BR>"}
|
||||
|
||||
if (items_counts.len==0 && reagents.reagent_list.len==0)
|
||||
dat = {"<B>The grill is empty</B><BR>"}
|
||||
else
|
||||
dat = {"<b>Ingredients:</b><br>[dat]"}
|
||||
dat += {"<HR><BR>\
|
||||
<A href='?src=\ref[src];action=cook'>Turn on!<BR>\
|
||||
<A href='?src=\ref[src];action=dispose'>Eject ingredients!<BR>\
|
||||
"}
|
||||
|
||||
user << browse("<HEAD><TITLE>grill Controls</TITLE></HEAD><TT>[dat]</TT>", "window=grill")
|
||||
onclose(user, "grill")
|
||||
return
|
||||
|
||||
|
||||
|
||||
/***********************************
|
||||
* grill Menu Handling/Cooking
|
||||
************************************/
|
||||
|
||||
/obj/machinery/grill/proc/cook()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
start()
|
||||
if (reagents.total_volume==0 && !(locate(/obj) in contents)) //dry run
|
||||
if (!wzhzhzh(10))
|
||||
abort()
|
||||
return
|
||||
stop()
|
||||
return
|
||||
|
||||
var/datum/recipe/recipe = select_recipe(available_recipes,src)
|
||||
var/obj/cooked
|
||||
if (!recipe)
|
||||
dirty += 1
|
||||
if (prob(max(10,dirty*5)))
|
||||
if (!wzhzhzh(4))
|
||||
abort()
|
||||
return
|
||||
muck_start()
|
||||
wzhzhzh(4)
|
||||
muck_finish()
|
||||
cooked = fail()
|
||||
cooked.loc = src.loc
|
||||
return
|
||||
else if (has_extra_item())
|
||||
if (!wzhzhzh(4))
|
||||
abort()
|
||||
return
|
||||
broke()
|
||||
cooked = fail()
|
||||
cooked.loc = src.loc
|
||||
return
|
||||
else
|
||||
if (!wzhzhzh(10))
|
||||
abort()
|
||||
return
|
||||
stop()
|
||||
cooked = fail()
|
||||
cooked.loc = src.loc
|
||||
return
|
||||
else
|
||||
var/halftime = round(recipe.time/10/2)
|
||||
if (!wzhzhzh(halftime))
|
||||
abort()
|
||||
return
|
||||
if (!wzhzhzh(halftime))
|
||||
abort()
|
||||
cooked = fail()
|
||||
cooked.loc = src.loc
|
||||
return
|
||||
cooked = recipe.make_food(src)
|
||||
stop()
|
||||
if(cooked)
|
||||
cooked.loc = src.loc
|
||||
for(var/i=1,i<efficiency,i++)
|
||||
cooked = new cooked.type(loc)
|
||||
return
|
||||
|
||||
/obj/machinery/grill/proc/wzhzhzh(var/seconds as num)
|
||||
for (var/i=1 to seconds)
|
||||
if (stat & (NOPOWER|BROKEN))
|
||||
return 0
|
||||
use_power(500)
|
||||
sleep(10)
|
||||
return 1
|
||||
|
||||
/obj/machinery/grill/proc/has_extra_item()
|
||||
for (var/obj/O in contents)
|
||||
if ( \
|
||||
!istype(O,/obj/item/weapon/reagent_containers/food) && \
|
||||
!istype(O, /obj/item/weapon/grown) \
|
||||
)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/grill/proc/start()
|
||||
src.visible_message("\blue The grill turns on.", "\blue You hear a grill.")
|
||||
src.operating = 1
|
||||
src.icon_state = "grill_on"
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/grill/proc/abort()
|
||||
src.operating = 0 // Turn it off again aferwards
|
||||
src.icon_state = "grill_off"
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/grill/proc/stop()
|
||||
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1)
|
||||
src.operating = 0 // Turn it off again aferwards
|
||||
src.icon_state = "grill_off"
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/grill/proc/dispose()
|
||||
for (var/obj/O in contents)
|
||||
O.loc = src.loc
|
||||
if (src.reagents.total_volume)
|
||||
src.dirty++
|
||||
src.reagents.clear_reagents()
|
||||
usr << "\blue You dispose of the grill contents."
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/grill/proc/muck_start()
|
||||
playsound(src.loc, 'sound/effects/splat.ogg', 50, 1) // Play a splat sound
|
||||
src.icon_state = "grill_dirty" // Make it look dirty!!
|
||||
|
||||
/obj/machinery/grill/proc/muck_finish()
|
||||
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1)
|
||||
src.visible_message("\red The grill gets covered in muck!")
|
||||
src.dirty = 100 // Make it dirty so it can't be used util cleaned
|
||||
src.flags = null //So you can't add condiments
|
||||
src.icon_state = "grill_dirty" // Make it look dirty too
|
||||
src.operating = 0 // Turn it off again aferwards
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/grill/proc/broke()
|
||||
var/datum/effect/effect/system/spark_spread/s = new
|
||||
s.set_up(2, 1, src)
|
||||
s.start()
|
||||
src.icon_state = "grill_broke" // Make it look all busted up and shit
|
||||
src.visible_message("\red The grill breaks!") //Let them know they're stupid
|
||||
src.broken = 2 // Make it broken so it can't be used util fixed
|
||||
src.flags = null //So you can't add condiments
|
||||
src.operating = 0 // Turn it off again aferwards
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/grill/proc/fail()
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/badrecipe/ffuu = new(src)
|
||||
var/amount = 0
|
||||
for (var/obj/O in contents-ffuu)
|
||||
amount++
|
||||
if (O.reagents)
|
||||
var/id = O.reagents.get_master_reagent_id()
|
||||
if (id)
|
||||
amount+=O.reagents.get_reagent_amount(id)
|
||||
qdel(O)
|
||||
src.reagents.clear_reagents()
|
||||
ffuu.reagents.add_reagent("carbon", amount)
|
||||
ffuu.reagents.add_reagent("????", amount/10)
|
||||
return ffuu
|
||||
|
||||
/obj/machinery/grill/Topic(href, href_list)
|
||||
if(..() || panel_open)
|
||||
return
|
||||
|
||||
usr.set_machine(src)
|
||||
if(src.operating)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
switch(href_list["action"])
|
||||
if ("cook")
|
||||
cook()
|
||||
|
||||
if ("dispose")
|
||||
dispose()
|
||||
return
|
||||
+12
-393
@@ -1,25 +1,16 @@
|
||||
|
||||
/obj/machinery/oven
|
||||
/obj/machinery/kitchen_machine/oven
|
||||
name = "oven"
|
||||
desc = "Cookies are ready, dear."
|
||||
icon = 'icons/obj/cooking_machines.dmi'
|
||||
icon_state = "oven_off"
|
||||
layer = 2.9
|
||||
density = 1
|
||||
anchored = 1
|
||||
use_power = 1
|
||||
idle_power_usage = 5
|
||||
active_power_usage = 100
|
||||
flags = OPENCONTAINER | NOREACT
|
||||
var/operating = 0 // Is it on?
|
||||
var/dirty = 0 // = {0..100} Does it need cleaning?
|
||||
var/broken = 0 // ={0,1,2} How broken is it???
|
||||
var/global/list/datum/recipe/available_recipes // List of the recipes you can use
|
||||
var/global/list/acceptable_items // List of the items you can put in
|
||||
var/global/list/acceptable_reagents // List of the reagents you can put in
|
||||
var/global/max_n_of_items = 0
|
||||
var/efficiency
|
||||
|
||||
cook_verbs = list("Baking", "Roasting", "Broiling")
|
||||
recipe_type = /datum/recipe/oven
|
||||
off_icon = "oven_off"
|
||||
on_icon = "oven_on"
|
||||
broken_icon = "oven_broke"
|
||||
dirty_icon = "oven_dirty"
|
||||
open_icon = "oven_open"
|
||||
|
||||
// see code/modules/food/recipes_oven.dm for recipes
|
||||
|
||||
@@ -27,29 +18,8 @@
|
||||
* Initialising
|
||||
********************/
|
||||
|
||||
/obj/machinery/oven/New()
|
||||
//..() //do not need this
|
||||
reagents = new/datum/reagents(100)
|
||||
reagents.my_atom = src
|
||||
if (!available_recipes)
|
||||
available_recipes = new
|
||||
for (var/type in (typesof(/datum/recipe/oven)-/datum/recipe/oven))
|
||||
var/datum/recipe/recipe = new type
|
||||
if(recipe.result) // Ignore recipe subtypes that lack a result
|
||||
available_recipes += recipe
|
||||
else
|
||||
qdel(recipe)
|
||||
acceptable_items = new
|
||||
acceptable_reagents = new
|
||||
for (var/datum/recipe/oven/recipe in available_recipes)
|
||||
for (var/item in recipe.items)
|
||||
acceptable_items |= item
|
||||
for (var/reagent in recipe.reagents)
|
||||
acceptable_reagents |= reagent
|
||||
if (recipe.items)
|
||||
max_n_of_items = max(max_n_of_items,recipe.items.len)
|
||||
acceptable_items |= /obj/item/weapon/reagent_containers/food/snacks/grown
|
||||
|
||||
/obj/machinery/kitchen_machine/oven/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/oven(null)
|
||||
component_parts += new /obj/item/weapon/stock_parts/micro_laser(null)
|
||||
@@ -58,8 +28,7 @@
|
||||
component_parts += new /obj/item/stack/cable_coil(null, 5)
|
||||
RefreshParts()
|
||||
|
||||
|
||||
/obj/machinery/oven/upgraded/New()
|
||||
/obj/machinery/kitchen_machine/oven/upgraded/New()
|
||||
..()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/oven(null)
|
||||
@@ -69,358 +38,8 @@
|
||||
component_parts += new /obj/item/stack/cable_coil(null, 5)
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/oven/RefreshParts()
|
||||
/obj/machinery/kitchen_machine/oven/RefreshParts()
|
||||
var/E
|
||||
for(var/obj/item/weapon/stock_parts/micro_laser/M in component_parts)
|
||||
E += M.rating
|
||||
efficiency = round((E/2), 1) // There's 2 lasers, so halve the effect on the efficiency to keep it balanced
|
||||
|
||||
/*******************
|
||||
* Item Adding
|
||||
********************/
|
||||
|
||||
/obj/machinery/oven/attackby(var/obj/item/O as obj, var/mob/user as mob, params)
|
||||
if(operating)
|
||||
return
|
||||
if(!broken && dirty < 100)
|
||||
if(default_deconstruction_screwdriver(user, "oven_open", "oven_off", O))
|
||||
return
|
||||
if(exchange_parts(user, O))
|
||||
return
|
||||
if(!broken && istype(O, /obj/item/weapon/wrench))
|
||||
playsound(src, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
if(anchored)
|
||||
anchored = 0
|
||||
user << "<span class='caution'>The [src] can now be moved.</span>"
|
||||
return
|
||||
else if(!anchored)
|
||||
anchored = 1
|
||||
user << "<span class='caution'>The [src] is now secured.</span>"
|
||||
return
|
||||
|
||||
default_deconstruction_crowbar(O)
|
||||
|
||||
if(src.broken > 0)
|
||||
if(src.broken == 2 && istype(O, /obj/item/weapon/screwdriver)) // If it's broken and they're using a screwdriver
|
||||
user.visible_message( \
|
||||
"\blue [user] starts to fix part of the oven.", \
|
||||
"\blue You start to fix part of the oven." \
|
||||
)
|
||||
if (do_after(user,20))
|
||||
user.visible_message( \
|
||||
"\blue [user] fixes part of the oven.", \
|
||||
"\blue You have fixed part of the oven." \
|
||||
)
|
||||
src.broken = 1 // Fix it a bit
|
||||
else if(src.broken == 1 && istype(O, /obj/item/weapon/wrench)) // If it's broken and they're doing the wrench
|
||||
user.visible_message( \
|
||||
"\blue [user] starts to fix part of the oven.", \
|
||||
"\blue You start to fix part of the oven." \
|
||||
)
|
||||
if (do_after(user,20))
|
||||
user.visible_message( \
|
||||
"\blue [user] fixes the oven.", \
|
||||
"\blue You have fixed the oven." \
|
||||
)
|
||||
src.icon_state = "oven_off"
|
||||
src.broken = 0 // Fix it!
|
||||
src.dirty = 0 // just to be sure
|
||||
src.flags = OPENCONTAINER
|
||||
else
|
||||
user << "\red It's broken!"
|
||||
return 1
|
||||
else if(src.dirty==100) // The oven is all dirty so can't be used!
|
||||
if(istype(O, /obj/item/weapon/reagent_containers/spray/cleaner) || istype(O, /obj/item/weapon/soap)) // If they're trying to clean it then let them
|
||||
user.visible_message( \
|
||||
"\blue [user] starts to clean the oven.", \
|
||||
"\blue You start to clean the oven." \
|
||||
)
|
||||
if (do_after(user,20))
|
||||
user.visible_message( \
|
||||
"\blue [user] has cleaned the oven.", \
|
||||
"\blue You have cleaned the oven." \
|
||||
)
|
||||
src.dirty = 0 // It's clean!
|
||||
src.broken = 0 // just to be sure
|
||||
src.icon_state = "oven_off"
|
||||
src.flags = OPENCONTAINER
|
||||
else //Otherwise bad luck!!
|
||||
user << "\red It's dirty!"
|
||||
return 1
|
||||
else if(is_type_in_list(O,acceptable_items))
|
||||
if (contents.len>=max_n_of_items)
|
||||
user << "\red This [src] is full of ingredients, you cannot put more."
|
||||
return 1
|
||||
if (istype(O,/obj/item/stack) && O:amount>1)
|
||||
new O.type (src)
|
||||
O:use(1)
|
||||
user.visible_message( \
|
||||
"\blue [user] has added one of [O] to \the [src].", \
|
||||
"\blue You add one of [O] to \the [src].")
|
||||
else
|
||||
// user.unEquip(O) //This just causes problems so far as I can tell. -Pete
|
||||
if(!user.drop_item())
|
||||
user << "<span class='notice'>\the [O] is stuck to your hand, you cannot put it in \the [src]</span>"
|
||||
return 0
|
||||
O.loc = src
|
||||
user.visible_message( \
|
||||
"\blue [user] has added \the [O] to \the [src].", \
|
||||
"\blue You add \the [O] to \the [src].")
|
||||
else if(istype(O,/obj/item/weapon/reagent_containers/glass) || \
|
||||
istype(O,/obj/item/weapon/reagent_containers/food/drinks) || \
|
||||
istype(O,/obj/item/weapon/reagent_containers/food/condiment) \
|
||||
)
|
||||
if (!O.reagents)
|
||||
return 1
|
||||
for (var/datum/reagent/R in O.reagents.reagent_list)
|
||||
if (!(R.id in acceptable_reagents))
|
||||
user << "\red Your [O] contains components unsuitable for cookery."
|
||||
return 1
|
||||
//G.reagents.trans_to(src,G.amount_per_transfer_from_this)
|
||||
else if(istype(O,/obj/item/weapon/grab))
|
||||
var/obj/item/weapon/grab/G = O
|
||||
user << "\red This is ridiculous. You can not fit \the [G.affecting] in this [src]."
|
||||
return 1
|
||||
else
|
||||
user << "\red You have no idea what you can cook with this [O]."
|
||||
return 1
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/oven/attack_ai(mob/user as mob)
|
||||
return 0
|
||||
|
||||
/obj/machinery/oven/attack_hand(mob/user as mob)
|
||||
user.set_machine(src)
|
||||
interact(user)
|
||||
|
||||
/*******************
|
||||
* oven Menu
|
||||
********************/
|
||||
|
||||
/obj/machinery/oven/interact(mob/user as mob) // The oven Menu
|
||||
if(panel_open || !anchored)
|
||||
return
|
||||
var/dat = ""
|
||||
if(src.broken > 0)
|
||||
dat = {"<TT>Bzzzzttttt</TT>"}
|
||||
else if(src.operating)
|
||||
dat = {"<TT>Baking in progress!<BR>Please wait...!</TT>"}
|
||||
else if(src.dirty==100)
|
||||
dat = {"<TT>This oven is dirty!<BR>Please clean it before use!</TT>"}
|
||||
else
|
||||
var/list/items_counts = new
|
||||
var/list/items_measures = new
|
||||
var/list/items_measures_p = new
|
||||
for (var/obj/O in contents)
|
||||
var/display_name = O.name
|
||||
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/egg))
|
||||
items_measures[display_name] = "egg"
|
||||
items_measures_p[display_name] = "eggs"
|
||||
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/tofu))
|
||||
items_measures[display_name] = "tofu chunk"
|
||||
items_measures_p[display_name] = "tofu chunks"
|
||||
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/meat)) //any meat
|
||||
items_measures[display_name] = "slab of meat"
|
||||
items_measures_p[display_name] = "slabs of meat"
|
||||
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/donkpocket))
|
||||
display_name = "Turnovers"
|
||||
items_measures[display_name] = "turnover"
|
||||
items_measures_p[display_name] = "turnovers"
|
||||
if (istype(O,/obj/item/weapon/reagent_containers/food/snacks/carpmeat))
|
||||
items_measures[display_name] = "fillet of meat"
|
||||
items_measures_p[display_name] = "fillets of meat"
|
||||
items_counts[display_name]++
|
||||
for (var/O in items_counts)
|
||||
var/N = items_counts[O]
|
||||
if (!(O in items_measures))
|
||||
dat += {"<B>[capitalize(O)]:</B> [N] [lowertext(O)]\s<BR>"}
|
||||
else
|
||||
if (N==1)
|
||||
dat += {"<B>[capitalize(O)]:</B> [N] [items_measures[O]]<BR>"}
|
||||
else
|
||||
dat += {"<B>[capitalize(O)]:</B> [N] [items_measures_p[O]]<BR>"}
|
||||
|
||||
for (var/datum/reagent/R in reagents.reagent_list)
|
||||
var/display_name = R.name
|
||||
if (R.id == "capsaicin")
|
||||
display_name = "Hotsauce"
|
||||
if (R.id == "frostoil")
|
||||
display_name = "Coldsauce"
|
||||
dat += {"<B>[display_name]:</B> [R.volume] unit\s<BR>"}
|
||||
|
||||
if (items_counts.len==0 && reagents.reagent_list.len==0)
|
||||
dat = {"<B>The oven is empty</B><BR>"}
|
||||
else
|
||||
dat = {"<b>Ingredients:</b><br>[dat]"}
|
||||
dat += {"<HR><BR>\
|
||||
<A href='?src=\ref[src];action=cook'>Turn on!<BR>\
|
||||
<A href='?src=\ref[src];action=dispose'>Eject ingredients!<BR>\
|
||||
"}
|
||||
|
||||
user << browse("<HEAD><TITLE>oven Controls</TITLE></HEAD><TT>[dat]</TT>", "window=oven")
|
||||
onclose(user, "oven")
|
||||
return
|
||||
|
||||
|
||||
|
||||
/***********************************
|
||||
* oven Menu Handling/Cooking
|
||||
************************************/
|
||||
|
||||
/obj/machinery/oven/proc/cook()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
start()
|
||||
if (reagents.total_volume==0 && !(locate(/obj) in contents)) //dry run
|
||||
if (!wzhzhzh(10))
|
||||
abort()
|
||||
return
|
||||
stop()
|
||||
return
|
||||
|
||||
var/datum/recipe/recipe = select_recipe(available_recipes,src)
|
||||
var/obj/cooked
|
||||
if (!recipe)
|
||||
dirty += 1
|
||||
if (prob(max(10,dirty*5)))
|
||||
if (!wzhzhzh(4))
|
||||
abort()
|
||||
return
|
||||
muck_start()
|
||||
wzhzhzh(4)
|
||||
muck_finish()
|
||||
cooked = fail()
|
||||
cooked.loc = src.loc
|
||||
return
|
||||
else if (has_extra_item())
|
||||
if (!wzhzhzh(4))
|
||||
abort()
|
||||
return
|
||||
broke()
|
||||
cooked = fail()
|
||||
cooked.loc = src.loc
|
||||
return
|
||||
else
|
||||
if (!wzhzhzh(10))
|
||||
abort()
|
||||
return
|
||||
stop()
|
||||
cooked = fail()
|
||||
cooked.loc = src.loc
|
||||
return
|
||||
else
|
||||
var/halftime = round(recipe.time/10/2)
|
||||
if (!wzhzhzh(halftime))
|
||||
abort()
|
||||
return
|
||||
if (!wzhzhzh(halftime))
|
||||
abort()
|
||||
cooked = fail()
|
||||
cooked.loc = src.loc
|
||||
return
|
||||
cooked = recipe.make_food(src)
|
||||
stop()
|
||||
if(cooked)
|
||||
cooked.loc = src.loc
|
||||
for(var/i=1,i<efficiency,i++)
|
||||
cooked = new cooked.type(loc)
|
||||
return
|
||||
|
||||
/obj/machinery/oven/proc/wzhzhzh(var/seconds as num)
|
||||
for (var/i=1 to seconds)
|
||||
if (stat & (NOPOWER|BROKEN))
|
||||
return 0
|
||||
use_power(500)
|
||||
sleep(10)
|
||||
return 1
|
||||
|
||||
/obj/machinery/oven/proc/has_extra_item()
|
||||
for (var/obj/O in contents)
|
||||
if ( \
|
||||
!istype(O,/obj/item/weapon/reagent_containers/food) && \
|
||||
!istype(O, /obj/item/weapon/grown) \
|
||||
)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/obj/machinery/oven/proc/start()
|
||||
src.visible_message("\blue The oven turns on.", "\blue You hear a oven.")
|
||||
src.operating = 1
|
||||
src.icon_state = "oven_on"
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/oven/proc/abort()
|
||||
src.operating = 0 // Turn it off again aferwards
|
||||
src.icon_state = "oven_off"
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/oven/proc/stop()
|
||||
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1)
|
||||
src.operating = 0 // Turn it off again aferwards
|
||||
src.icon_state = "oven_off"
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/oven/proc/dispose()
|
||||
for (var/obj/O in contents)
|
||||
O.loc = src.loc
|
||||
if (src.reagents.total_volume)
|
||||
src.dirty++
|
||||
src.reagents.clear_reagents()
|
||||
usr << "\blue You dispose of the oven contents."
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/oven/proc/muck_start()
|
||||
playsound(src.loc, 'sound/effects/splat.ogg', 50, 1) // Play a splat sound
|
||||
src.icon_state = "oven_dirty" // Make it look dirty!!
|
||||
|
||||
/obj/machinery/oven/proc/muck_finish()
|
||||
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1)
|
||||
src.visible_message("\red The oven gets covered in muck!")
|
||||
src.dirty = 100 // Make it dirty so it can't be used util cleaned
|
||||
src.flags = null //So you can't add condiments
|
||||
src.icon_state = "oven_dirty" // Make it look dirty too
|
||||
src.operating = 0 // Turn it off again aferwards
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/oven/proc/broke()
|
||||
var/datum/effect/effect/system/spark_spread/s = new
|
||||
s.set_up(2, 1, src)
|
||||
s.start()
|
||||
src.icon_state = "oven_broke" // Make it look all busted up and shit
|
||||
src.visible_message("\red The oven breaks!") //Let them know they're stupid
|
||||
src.broken = 2 // Make it broken so it can't be used util fixed
|
||||
src.flags = null //So you can't add condiments
|
||||
src.operating = 0 // Turn it off again aferwards
|
||||
src.updateUsrDialog()
|
||||
|
||||
/obj/machinery/oven/proc/fail()
|
||||
var/obj/item/weapon/reagent_containers/food/snacks/badrecipe/ffuu = new(src)
|
||||
var/amount = 0
|
||||
for (var/obj/O in contents-ffuu)
|
||||
amount++
|
||||
if (O.reagents)
|
||||
var/id = O.reagents.get_master_reagent_id()
|
||||
if (id)
|
||||
amount+=O.reagents.get_reagent_amount(id)
|
||||
qdel(O)
|
||||
src.reagents.clear_reagents()
|
||||
ffuu.reagents.add_reagent("carbon", amount)
|
||||
ffuu.reagents.add_reagent("????", amount/10)
|
||||
return ffuu
|
||||
|
||||
/obj/machinery/oven/Topic(href, href_list)
|
||||
if(..() || panel_open)
|
||||
return
|
||||
|
||||
usr.set_machine(src)
|
||||
if(src.operating)
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
switch(href_list["action"])
|
||||
if ("cook")
|
||||
cook()
|
||||
|
||||
if ("dispose")
|
||||
dispose()
|
||||
return
|
||||
@@ -37,7 +37,7 @@ var/global/datum/controller/plants/plant_controller // Set in New().
|
||||
/datum/controller/plants/New()
|
||||
if(plant_controller && plant_controller != src)
|
||||
log_debug("Rebuilding plant controller.")
|
||||
qdel(plant_controller)
|
||||
del(plant_controller)
|
||||
plant_controller = src
|
||||
setup()
|
||||
process()
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
qdel(container)//Gets rid of the MMI if there is one
|
||||
if(loc)
|
||||
if(istype(loc,/obj/item/organ/brain))
|
||||
del(loc)//Gets rid of the brain item
|
||||
qdel(loc)//Gets rid of the brain item
|
||||
spawn(15)
|
||||
if(animation) qdel(animation)
|
||||
if(src) qdel(src)
|
||||
@@ -505,6 +505,7 @@ emp_act
|
||||
return
|
||||
|
||||
/mob/living/carbon/human/experience_pressure_difference(pressure_difference, direction)
|
||||
playsound(src, 'sound/effects/space_wind.ogg', 50, 1)
|
||||
if(shoes)
|
||||
if(istype(shoes,/obj/item/clothing/shoes/magboots) && (shoes.flags & NOSLIP)) //TODO: Make a not-shit shoe var system to negate airflow.
|
||||
return 0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -243,7 +243,7 @@ var/global/list/damage_icon_parts = list()
|
||||
//0 = destroyed, 1 = normal, 2 = robotic, 3 = necrotic.
|
||||
//Create a new, blank icon for our mob to use.
|
||||
if(stand_icon)
|
||||
del(stand_icon)
|
||||
qdel(stand_icon)
|
||||
stand_icon = new(species.icon_template ? species.icon_template : 'icons/mob/human.dmi',"blank")
|
||||
var/icon_key = "[species.race_key][g][s_tone][r_skin][g_skin][b_skin]"
|
||||
var/obj/item/organ/eyes/eyes = internal_organs_by_name["eyes"]
|
||||
@@ -447,7 +447,7 @@ var/global/list/damage_icon_parts = list()
|
||||
if (targeted_by && target_locked)
|
||||
overlays_standing[TARGETED_LAYER] = target_locked
|
||||
else if (!targeted_by && target_locked)
|
||||
del(target_locked)
|
||||
qdel(target_locked)
|
||||
if (!targeted_by)
|
||||
overlays_standing[TARGETED_LAYER] = null
|
||||
if(update_icons) update_icons()
|
||||
|
||||
@@ -485,6 +485,10 @@
|
||||
if ((!(L.stat) && !(L.restrained())))
|
||||
resist_grab(L) //this passes L because the proc requires a typecasted mob/living instead of just 'src'
|
||||
|
||||
// Sliding out of a morgue/crematorium
|
||||
if(loc && (istype(loc, /obj/structure/morgue) || istype(loc, /obj/structure/crematorium)))
|
||||
resist_tray(L)
|
||||
|
||||
//unbuckling yourself
|
||||
if(L.buckled && (L.last_special <= world.time) )
|
||||
resist_buckle(L) //this passes L because the proc requires a typecasted mob/living instead of just 'src'
|
||||
@@ -687,6 +691,17 @@
|
||||
BD.attack_hand(usr)
|
||||
C.open()
|
||||
|
||||
// resist_tray allows a mob to slide themselves out of a morgue or crematorium
|
||||
/mob/living/proc/resist_tray(var/mob/living/carbon/CM)
|
||||
if(!istype(CM))
|
||||
return
|
||||
if (usr.stat || usr.restrained())
|
||||
return
|
||||
|
||||
usr << "<span class='alert'>You attempt to slide yourself out of \the [loc]...</span>"
|
||||
var/obj/structure/S = loc
|
||||
S.attack_hand(src)
|
||||
|
||||
/* resist_stop_drop_roll allows a mob to stop, drop, and roll in order to put out a fire burning on them.
|
||||
*/////
|
||||
/mob/living/proc/resist_stop_drop_roll(var/mob/living/carbon/CM)
|
||||
|
||||
@@ -41,30 +41,6 @@
|
||||
src << "\blue Your [C.name] was disrupted!"
|
||||
Stun(2)
|
||||
|
||||
/*
|
||||
//Being hit while using a deadman switch
|
||||
if(istype(equipped(),/obj/item/device/assembly/signaler))
|
||||
var/obj/item/device/assembly/signaler/signaler = equipped()
|
||||
if(signaler.deadman && prob(80))
|
||||
src.visible_message("\red [src] triggers their deadman's switch!")
|
||||
signaler.signal()
|
||||
*/
|
||||
|
||||
/*
|
||||
//Stun Beams -- These were commented out, making appropriate changes here. - Dave
|
||||
if(istype(P, /obj/item/projectile/beam/stun) || istype(P, /obj/item/projectile/bullet/stunshot))
|
||||
stun_effect_act(0, P.agony, def_zone, P)
|
||||
src <<"\red You have been hit by [P]!"
|
||||
del P
|
||||
return
|
||||
|
||||
if(istype(P, /obj/item/projectile/energy/electrode) || istype(P, /obj/item/projectile/bullet/stunshot))
|
||||
stun_effect_act(0, P.agony, def_zone, P)
|
||||
src <<"\red You have been hit by [P]!"
|
||||
del P
|
||||
return
|
||||
*/
|
||||
|
||||
//Armor
|
||||
var/armor = run_armor_check(def_zone, P.flag)
|
||||
var/proj_sharp = is_sharp(P)
|
||||
|
||||
@@ -34,11 +34,11 @@ var/global/list/empty_playable_ai_cores = list()
|
||||
job_master.FreeRole(job)
|
||||
|
||||
if(mind.objectives.len)
|
||||
del(mind.objectives)
|
||||
qdel(mind.objectives)
|
||||
mind.special_role = null
|
||||
else
|
||||
if(ticker.mode.name == "AutoTraitor")
|
||||
var/datum/game_mode/traitor/autotraitor/current_mode = ticker.mode
|
||||
current_mode.possible_traitors.Remove(src)
|
||||
|
||||
del(src)
|
||||
qdel(src)
|
||||
@@ -22,8 +22,8 @@
|
||||
|
||||
//New pAI's get a brand new mind to prevent meta stuff from their previous life. This new mind causes problems down the line if it's not deleted here.
|
||||
//Read as: I have no idea what I'm doing but asking for help got me nowhere so this is what you get. - Nodrak
|
||||
if(mind) del(mind)
|
||||
if(mind) qdel(mind)
|
||||
living_mob_list -= src
|
||||
ghostize()
|
||||
if(icon_state != "[chassis]_dead")
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
layer = 4.0
|
||||
animate_movement = 2
|
||||
// flags = NOREACT
|
||||
pressure_resistance = 8
|
||||
var/datum/mind/mind
|
||||
|
||||
var/stat = 0 //Whether a mob is alive or dead. TODO: Move this to living - Nodrak
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
..()
|
||||
if(!spawning)//Here so that if they are spawning and log out, the other procs can play out and they will have a mob to come back to.
|
||||
key = null//We null their key before deleting the mob, so they are properly kicked out.
|
||||
del(src)
|
||||
qdel(src)
|
||||
return
|
||||
@@ -138,7 +138,7 @@
|
||||
observer.verbs -= /mob/dead/observer/verb/toggle_antagHUD // Poor guys, don't know what they are missing!
|
||||
observer.key = key
|
||||
respawnable_list += observer
|
||||
del(src)
|
||||
qdel(src)
|
||||
return 1
|
||||
|
||||
if(href_list["late_join"])
|
||||
@@ -325,8 +325,8 @@
|
||||
AnnounceCyborg(character, rank, "has been downloaded to the empty core in \the [character.loc.loc]")
|
||||
ticker.mode.latespawn(character)
|
||||
|
||||
del(C)
|
||||
del(src)
|
||||
qdel(C)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
//Find our spawning point.
|
||||
@@ -364,7 +364,7 @@
|
||||
else
|
||||
AnnounceCyborg(character, rank, join_message)
|
||||
callHook("latespawn", list(character))
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
|
||||
proc/AnnounceArrival(var/mob/living/carbon/human/character, var/rank, var/join_message)
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
throw_range = 1
|
||||
throw_speed = 1
|
||||
layer = 4
|
||||
pressure_resistance = 1
|
||||
pressure_resistance = 0
|
||||
slot_flags = SLOT_HEAD
|
||||
body_parts_covered = HEAD
|
||||
attack_verb = list("bapped")
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
w_class = 3
|
||||
throw_speed = 3
|
||||
throw_range = 7
|
||||
pressure_resistance = 10
|
||||
pressure_resistance = 8
|
||||
var/amount = 30 //How much paper is in the bin.
|
||||
var/list/papers = new/list() //List of papers put in the bin for reference.
|
||||
/*
|
||||
|
||||
@@ -591,7 +591,7 @@
|
||||
sleep(2)
|
||||
explosion(T, 0, 0, 2, 2)
|
||||
sleep(1)
|
||||
del(src)
|
||||
qdel(src)
|
||||
|
||||
// the light item
|
||||
// can be tube or bulb subtypes
|
||||
|
||||
Reference in New Issue
Block a user