This commit is contained in:
Nanai
2013-10-19 13:13:02 -04:00
213 changed files with 17493 additions and 16999 deletions

View File

@@ -30,6 +30,24 @@
#include "code\__HELPERS\time.dm"
#include "code\__HELPERS\type2type.dm"
#include "code\__HELPERS\unsorted.dm"
#include "code\_onclick\adjacent.dm"
#include "code\_onclick\ai.dm"
#include "code\_onclick\click.dm"
#include "code\_onclick\cyborg.dm"
#include "code\_onclick\drag_drop.dm"
#include "code\_onclick\item_attack.dm"
#include "code\_onclick\observer.dm"
#include "code\_onclick\other_mobs.dm"
#include "code\_onclick\telekinesis.dm"
#include "code\_onclick\hud\_defines.dm"
#include "code\_onclick\hud\alien.dm"
#include "code\_onclick\hud\alien_larva.dm"
#include "code\_onclick\hud\hud.dm"
#include "code\_onclick\hud\human.dm"
#include "code\_onclick\hud\monkey.dm"
#include "code\_onclick\hud\other_mobs.dm"
#include "code\_onclick\hud\robot.dm"
#include "code\_onclick\hud\screen_objects.dm"
#include "code\ATMOSPHERICS\atmospherics.dm"
#include "code\ATMOSPHERICS\datum_pipe_network.dm"
#include "code\ATMOSPHERICS\datum_pipeline.dm"
@@ -148,7 +166,6 @@
#include "code\game\atoms.dm"
#include "code\game\atoms_movable.dm"
#include "code\game\communications.dm"
#include "code\game\hud.dm"
#include "code\game\response_team.dm"
#include "code\game\shuttle_engines.dm"
#include "code\game\skincmd.dm"
@@ -429,7 +446,6 @@
#include "code\game\objects\items\crayons.dm"
#include "code\game\objects\items\latexballoon.dm"
#include "code\game\objects\items\shooting_range.dm"
#include "code\game\objects\items\tk_grab.dm"
#include "code\game\objects\items\toys.dm"
#include "code\game\objects\items\trash.dm"
#include "code\game\objects\items\devices\aicard.dm"
@@ -545,6 +561,7 @@
#include "code\game\objects\storage\coat.dm"
#include "code\game\objects\structures\barsign.dm"
#include "code\game\objects\structures\bedsheet_bin.dm"
#include "code\game\objects\structures\coathanger.dm"
#include "code\game\objects\structures\displaycase.dm"
#include "code\game\objects\structures\door_assembly.dm"
#include "code\game\objects\structures\electricchair.dm"
@@ -697,6 +714,7 @@
#include "code\modules\clothing\gloves\boxing.dm"
#include "code\modules\clothing\gloves\color.dm"
#include "code\modules\clothing\gloves\miscellaneous.dm"
#include "code\modules\clothing\gloves\ninja.dm"
#include "code\modules\clothing\gloves\stungloves.dm"
#include "code\modules\clothing\head\collectable.dm"
#include "code\modules\clothing\head\hardhat.dm"
@@ -740,7 +758,7 @@
#include "code\modules\clothing\under\jobs\security.dm"
#include "code\modules\customitems\item_defines.dm"
#include "code\modules\customitems\item_spawning.dm"
#include "code\modules\destilery\main.dm"
#include "code\modules\destilery\main.dm"
#include "code\modules\detectivework\detective_work.dm"
#include "code\modules\detectivework\evidence.dm"
#include "code\modules\detectivework\footprints_and_rag.dm"
@@ -748,12 +766,12 @@
#include "code\modules\economy\Accounts.dm"
#include "code\modules\economy\Accounts_DB.dm"
#include "code\modules\economy\ATM.dm"
#include "code\modules\economy\economy_misc.dm"
#include "code\modules\economy\EFTPOS.dm"
#include "code\modules\economy\Misc.dm"
#include "code\modules\economy\Events.dm"
#include "code\modules\economy\Events_Mundane.dm"
#include "code\modules\economy\Job_Departments.dm"
#include "code\modules\economy\TradeDestinations.dm"
#include "code\modules\economy\TradeDestinations.dm"
#include "code\modules\events\alien_infestation.dm"
#include "code\modules\events\blob.dm"
#include "code\modules\events\brand_intelligence.dm"
@@ -823,11 +841,9 @@
#include "code\modules\mob\mob_movement.dm"
#include "code\modules\mob\mob_transformation_simple.dm"
#include "code\modules\mob\say.dm"
#include "code\modules\mob\screen.dm"
#include "code\modules\mob\transform_procs.dm"
#include "code\modules\mob\update_icons.dm"
#include "code\modules\mob\dead\death.dm"
#include "code\modules\mob\dead\observer\hud.dm"
#include "code\modules\mob\dead\observer\logout.dm"
#include "code\modules\mob\dead\observer\observer.dm"
#include "code\modules\mob\dead\observer\say.dm"
@@ -853,7 +869,6 @@
#include "code\modules\mob\living\carbon\alien\humanoid\alien_powers.dm"
#include "code\modules\mob\living\carbon\alien\humanoid\death.dm"
#include "code\modules\mob\living\carbon\alien\humanoid\emote.dm"
#include "code\modules\mob\living\carbon\alien\humanoid\hud.dm"
#include "code\modules\mob\living\carbon\alien\humanoid\humanoid.dm"
#include "code\modules\mob\living\carbon\alien\humanoid\inventory.dm"
#include "code\modules\mob\living\carbon\alien\humanoid\life.dm"
@@ -865,7 +880,6 @@
#include "code\modules\mob\living\carbon\alien\humanoid\caste\sentinel.dm"
#include "code\modules\mob\living\carbon\alien\larva\death.dm"
#include "code\modules\mob\living\carbon\alien\larva\emote.dm"
#include "code\modules\mob\living\carbon\alien\larva\hud.dm"
#include "code\modules\mob\living\carbon\alien\larva\inventory.dm"
#include "code\modules\mob\living\carbon\alien\larva\larva.dm"
#include "code\modules\mob\living\carbon\alien\larva\life.dm"
@@ -877,7 +891,6 @@
#include "code\modules\mob\living\carbon\brain\brain_item.dm"
#include "code\modules\mob\living\carbon\brain\death.dm"
#include "code\modules\mob\living\carbon\brain\emote.dm"
#include "code\modules\mob\living\carbon\brain\hud.dm"
#include "code\modules\mob\living\carbon\brain\life.dm"
#include "code\modules\mob\living\carbon\brain\MMI.dm"
#include "code\modules\mob\living\carbon\brain\posibrain.dm"
@@ -885,7 +898,6 @@
#include "code\modules\mob\living\carbon\human\death.dm"
#include "code\modules\mob\living\carbon\human\emote.dm"
#include "code\modules\mob\living\carbon\human\examine.dm"
#include "code\modules\mob\living\carbon\human\hud.dm"
#include "code\modules\mob\living\carbon\human\human.dm"
#include "code\modules\mob\living\carbon\human\human_attackalien.dm"
#include "code\modules\mob\living\carbon\human\human_attackhand.dm"
@@ -914,7 +926,6 @@
#include "code\modules\mob\living\carbon\monkey\diona.dm"
#include "code\modules\mob\living\carbon\monkey\emote.dm"
#include "code\modules\mob\living\carbon\monkey\examine.dm"
#include "code\modules\mob\living\carbon\monkey\hud.dm"
#include "code\modules\mob\living\carbon\monkey\inventory.dm"
#include "code\modules\mob\living\carbon\monkey\life.dm"
#include "code\modules\mob\living\carbon\monkey\login.dm"
@@ -928,7 +939,6 @@
#include "code\modules\mob\living\silicon\ai\ai.dm"
#include "code\modules\mob\living\silicon\ai\death.dm"
#include "code\modules\mob\living\silicon\ai\examine.dm"
#include "code\modules\mob\living\silicon\ai\hud.dm"
#include "code\modules\mob\living\silicon\ai\laws.dm"
#include "code\modules\mob\living\silicon\ai\life.dm"
#include "code\modules\mob\living\silicon\ai\login.dm"
@@ -955,7 +965,6 @@
#include "code\modules\mob\living\silicon\robot\death.dm"
#include "code\modules\mob\living\silicon\robot\emote.dm"
#include "code\modules\mob\living\silicon\robot\examine.dm"
#include "code\modules\mob\living\silicon\robot\hud.dm"
#include "code\modules\mob\living\silicon\robot\inventory.dm"
#include "code\modules\mob\living\silicon\robot\laws.dm"
#include "code\modules\mob\living\silicon\robot\life.dm"
@@ -1001,7 +1010,6 @@
#include "code\modules\mob\living\simple_animal\hostile\retaliate\clown.dm"
#include "code\modules\mob\living\simple_animal\hostile\retaliate\drone.dm"
#include "code\modules\mob\living\simple_animal\hostile\retaliate\retaliate.dm"
#include "code\modules\mob\new_player\hud.dm"
#include "code\modules\mob\new_player\login.dm"
#include "code\modules\mob\new_player\logout.dm"
#include "code\modules\mob\new_player\new_player.dm"
@@ -1285,6 +1293,7 @@
#include "code\WorkInProgress\Cael_Aislinn\Supermatter\SuperMatter.dm"
#include "code\WorkInProgress\Cael_Aislinn\Supermatter\ZeroPointLaser.dm"
#include "code\WorkInProgress\Chinsky\ashtray.dm"
#include "code\WorkInProgress\Cib\MedicalSideEffects.dm"
#include "code\WorkInProgress\kilakk\fax.dm"
#include "code\WorkInProgress\Mini\atmos_control.dm"
#include "code\WorkInProgress\Ported\policetape.dm"

View File

@@ -1,5 +1,6 @@
// BEGIN_INTERNALS
/*
MAP_ICON_TYPE: 0
AUTO_FILE_DIR: OFF
*/
// END_INTERNALS

View File

@@ -336,3 +336,16 @@
initial_loc.air_vent_names -= id_tag
..()
return
/*
Alt-click to ventcrawl - Monkeys, aliens, and slimes
This is a little buggy but somehow that just seems to plague ventcrawl.
I am sorry, I don't know why.
*/
/obj/machinery/atmospherics/unary/vent_pump/AltClick(var/mob/living/carbon/ML)
if(istype(ML))
var/list/ventcrawl_verbs = list(/mob/living/carbon/monkey/verb/ventcrawl, /mob/living/carbon/alien/verb/ventcrawl, /mob/living/carbon/slime/verb/ventcrawl)
if(length(ML.verbs & ventcrawl_verbs)) // alien queens have this removed, an istype would be complicated
ML.handle_ventcrawl(src)
return
..()

View File

@@ -1,9 +1,31 @@
// MEDICAL SIDE EFFECT BASE
// ========================
/datum/medical_effect/var/name = "None"
/datum/medical_effect/var/strength = 0
/datum/medical_effect
var/name = "None"
var/strength = 0
var/start = 0
var/list/triggers
var/list/cures
var/cure_message
/datum/medical_effect/proc/manifest(mob/living/carbon/human/H)
for(var/R in cures)
if(H.reagents.has_reagent(R))
return 0
for(var/R in triggers)
if(H.reagents.get_reagent_amount(R) >= triggers[R])
return 1
return 0
/datum/medical_effect/proc/on_life(mob/living/carbon/human/H, strength)
return
/datum/medical_effect/proc/cure(mob/living/carbon/human/H)
for(var/R in cures)
if(H.reagents.has_reagent(R))
H <<"\red [cure_message]"
return 1
return 0
// MOB HELPERS
@@ -11,9 +33,11 @@
/mob/living/carbon/human/var/list/datum/medical_effect/side_effects = list()
/mob/proc/add_side_effect(name, strength = 0)
/mob/living/carbon/human/add_side_effect(name, strength = 0)
for(var/datum/medical_effect/M in src.side_effects) if(M.name == name)
M.strength = max(M.strength, 10)
return
for(var/datum/medical_effect/M in src.side_effects)
if(M.name == name)
M.strength = max(M.strength, 10)
M.start = life_tick
return
var/list/L = typesof(/datum/medical_effect)-/datum/medical_effect
@@ -21,128 +45,107 @@
var/datum/medical_effect/M = new T
if(M.name == name)
M.strength = strength
M.start = life_tick
side_effects += M
/mob/living/carbon/human/proc/handle_medical_side_effects()
if(src.reagents.has_reagent("cryoxadone") || src.reagents.get_reagent_amount("bicaridine") >= 15 || src.reagents.get_reagent_amount("tricordrazine") >= 15)
src.add_side_effect("Headache")
if(src.reagents.get_reagent_amount("kelotane") >= 30 || src.reagents.get_reagent_amount("dermaline") >= 15)
src.add_side_effect("Bad Stomach")
if(src.reagents.get_reagent_amount("tramadol") >= 16 || src.reagents.get_reagent_amount("anti_toxin") >= 30)
src.add_side_effect("Cramps")
if(src.reagents.get_reagent_amount("space_drugs") >= 10)
src.add_side_effect("Itch")
var/list/L = typesof(/datum/medical_effect)-/datum/medical_effect
for(var/T in L)
var/datum/medical_effect/M = new T
if (M.manifest(src))
src.add_side_effect(M.name)
// One full cycle(in terms of strength) every 10 minutes
var/strength_percent = sin(life_tick / 2)
for (var/datum/medical_effect/M in side_effects)
if (!M) continue
var/strength_percent = sin((life_tick - M.start) / 2)
log_debug ("[src], tick [life_tick] : Processing [M], Current phase: [strength_percent]")
// Only do anything if the effect is currently strong enough
if(strength_percent >= 0.4)
for (var/datum/medical_effect/M in side_effects)
if (M.cure(src) || M.strength > 60)
// Only do anything if the effect is currently strong enough
if(strength_percent >= 0.4)
log_debug ("[src], tick [life_tick] : Active phase ; strength [M.strength]")
if (M.cure(src) || M.strength > 50)
log_debug ("[src], tick [life_tick] : [M] cured or reached end of lifecycle")
side_effects -= M
del(M)
else
if(life_tick % 45 == 0)
log_debug ("[src], tick [life_tick] : Activating [M] ")
M.on_life(src, strength_percent*M.strength)
// Effect slowly growing stronger
M.strength+=0.08
// HEADACHE
// ========
/datum/medical_effect/headache/name = "Headache"
/datum/medical_effect/headache
name = "Headache"
triggers = list("cryoxadone" = 10, "bicaridine" = 15, "tricordrazine" = 15)
cures = list("alkysine", "tramadol")
cure_message = "Your head stops throbbing..."
/datum/medical_effect/headache/on_life(mob/living/carbon/human/H, strength)
switch(strength)
if(1 to 10)
H.custom_pain("You feel a light pain in your head.",0)
if(11 to 30)
H.custom_pain("You feel a throbbing pain in your head!",1)
if(31 to 50)
if(31 to INFINITY)
H.custom_pain("You feel an excrutiating pain in your head!",1)
H.adjustBrainLoss(1)
if(51 to INFINITY)
H.custom_pain("It feels like your head is about to split open!",1)
H.adjustBrainLoss(3)
var/datum/organ/external/O = H.organs_by_name["head"]
O.take_damage(0, 1, 0, "Headache")
/datum/medical_effect/headache/cure(mob/living/carbon/human/H)
if(H.reagents.has_reagent("alkysine") || H.reagents.has_reagent("tramadol"))
H << "\red Your head stops throbbing.."
return 1
return 0
// BAD STOMACH
// ===========
/datum/medical_effect/bad_stomach/name = "Bad Stomach"
/datum/medical_effect/bad_stomach
name = "Bad Stomach"
triggers = list("kelotane" = 30, "dermaline" = 15)
cures = list("anti_toxin")
cure_message = "Your stomach feels a little better now..."
/datum/medical_effect/bad_stomach/on_life(mob/living/carbon/human/H, strength)
switch(strength)
if(1 to 10)
H.custom_pain("You feel a bit light around the stomach.",0)
if(11 to 30)
H.custom_pain("Your stomach hurts.",0)
if(31 to 50)
if(31 to INFINITY)
H.custom_pain("You feel sick.",1)
H.adjustToxLoss(1)
if(51 to INFINITY)
H.custom_pain("You can't hold it in any longer!",1)
H.vomit()
/datum/medical_effect/bad_stomach/cure(mob/living/carbon/human/H)
if(H.reagents.has_reagent("anti_toxin"))
H << "\red Your stomach feels a little better now.."
return 1
return 0
// CRAMPS
// ======
/datum/medical_effect/cramps/name = "Cramps"
/datum/medical_effect/cramps
name = "Cramps"
triggers = list("anti_toxin" = 30, "tramadol" = 15)
cures = list("inaprovaline")
cure_message = "The cramps let up..."
/datum/medical_effect/cramps/on_life(mob/living/carbon/human/H, strength)
switch(strength)
if(1 to 10)
H.custom_pain("The muscles in your body hurt a little.",0)
if(11 to 30)
H.custom_pain("The muscles in your body cramp up painfully.",0)
if(31 to 50)
if(31 to INFINITY)
H.emote("me",1,"flinches as all the muscles in their body cramp up.")
H.custom_pain("There's pain all over your body.",1)
H.adjustToxLoss(1)
if(51 to INFINITY)
H.emote("me",1,"flinches as all the muscles in their body cramp up.")
H.custom_pain("It feels as though your muscles are being ripped apart!",1)
H.apply_damage(1, used_weapon = "Cramps")
/datum/medical_effect/cramps/cure(mob/living/carbon/human/H)
if(H.reagents.has_reagent("inaprovaline"))
H << "\red The cramps let up.."
return 1
return 0
// ITCH
// ====
/datum/medical_effect/itch/name = "Itch"
/datum/medical_effect/itch
name = "Itch"
triggers = list("space_drugs" = 10)
cures = list("inaprovaline")
cure_message = "The itching stops..."
/datum/medical_effect/itch/on_life(mob/living/carbon/human/H, strength)
switch(strength)
if(1 to 10)
H.custom_pain("You feel a slight itch.",0)
if(11 to 30)
H.custom_pain("You want to scratch your itch badly.",0)
if(31 to 50)
if(31 to INFINITY)
H.emote("me",1,"shivers slightly.")
H.custom_pain("This itch makes it really hard to concentrate.",1)
H.adjustToxLoss(1)
if(51 to INFINITY)
H.emote("me",1,"shivers.")
H.custom_pain("The itch starts hurting and oozing blood.",1)
H.apply_damage(1, BURN, used_weapon = "Itch")
H.drip(1)
/datum/medical_effect/itch/cure(mob/living/carbon/human/H)
if(H.reagents.has_reagent("inaprovaline"))
H << "\red The itching stops.."
return 1
return 0
H.adjustToxLoss(1)

View File

@@ -57,7 +57,7 @@
dir = NORTHWEST
if(NORTHWEST)
dir = NORTH
return
return 1
/obj/effect/bmode/buildhelp
icon = 'icons/misc/buildmode.dmi'
@@ -95,7 +95,7 @@
usr << "\blue Left Mouse Button on turf/obj/mob = Select"
usr << "\blue Right Mouse Button on turf/obj/mob = Throw"
usr << "\blue ***********************************************************"
return
return 1
/obj/effect/bmode/buildquit
icon_state = "buildquit"
@@ -103,6 +103,7 @@
Click()
togglebuildmode(master.cl.mob)
return 1
/obj/effect/bmode/buildholder
density = 0
@@ -142,7 +143,7 @@
else if(pa.Find("right"))
switch(master.cl.buildmode)
if(1)
return
return 1
if(2)
objholder = input(usr,"Enter typepath:" ,"Typepath","/obj/structure/closet")
var/list/removed_paths = list("/obj/effect/bhole")
@@ -156,9 +157,9 @@
master.buildmode.varholder = input(usr,"Enter variable name:" ,"Name", "name")
if(master.buildmode.varholder in locked && !check_rights(R_DEBUG,0))
return
return 1
var/thetype = input(usr,"Select variable type:" ,"Type") in list("text","number","mob-reference","obj-reference","turf-reference")
if(!thetype) return
if(!thetype) return 1
switch(thetype)
if("text")
master.buildmode.valueholder = input(usr,"Enter variable value:" ,"Value", "value") as text
@@ -170,9 +171,9 @@
master.buildmode.valueholder = input(usr,"Enter variable value:" ,"Value") as obj in world
if("turf-reference")
master.buildmode.valueholder = input(usr,"Enter variable value:" ,"Value") as turf in world
return 1
/proc/build_click(var/mob/user, buildmode, location, control, params, var/obj/object)
/proc/build_click(var/mob/user, buildmode, params, var/obj/object)
var/obj/effect/bmode/buildholder/holder = null
for(var/obj/effect/bmode/buildholder/H)
if(H.cl == user.client)

View File

@@ -1,5 +1,5 @@
/obj/effect/expl_particles
name = "fire"
name = "explosive particles"
icon = 'icons/effects/effects.dmi'
icon_state = "explosion_particle"
opacity = 1
@@ -9,7 +9,7 @@
/obj/effect/expl_particles/New()
..()
spawn (15)
del(src)
src.loc = null
return
/obj/effect/expl_particles/Move()
@@ -37,7 +37,7 @@
step(expl,direct)
/obj/effect/explosion
name = "fire"
name = "explosive particles"
icon = 'icons/effects/96x96.dmi'
icon_state = "explosion"
opacity = 1
@@ -49,7 +49,7 @@
/obj/effect/explosion/New()
..()
spawn (10)
del(src)
src.loc = null
return
/datum/effect/system/explosion

View File

@@ -6,9 +6,6 @@ Indirect connections will not merge the two zones after they reach equilibrium.
#define CONNECTION_INDIRECT 1
#define CONNECTION_CLOSED 0
#define ZONE_ACTIVE 1
#define ZONE_SLEEPING 0
/connection
var/turf/simulated/A
var/turf/simulated/B

View File

@@ -57,6 +57,8 @@ What are the archived variables for?
var/tmp/graphic_archived = 0
var/tmp/fuel_burnt = 0
var/reacting = 0
//FOR THE LOVE OF GOD PLEASE USE THIS PROC
//Call it with negative numbers to remove gases.
@@ -207,14 +209,13 @@ What are the archived variables for?
//Inputs: None
//Outputs: If a fire occured
var/reacting = 0 //set to 1 if a notable reaction occured (used by pipe_network)
//set to 1 if a notable reaction occured (used by pipe_network)
if(temperature > FIRE_MINIMUM_TEMPERATURE_TO_EXIST)
if(zburn(null) > 0)
reacting = 1
zburn(null)
return reacting
/*
/datum/gas_mixture/proc/fire()
//Purpose: Calculating any fire reactions.
//Called by: react() (See above)
@@ -223,7 +224,7 @@ What are the archived variables for?
return zburn(null)
/*var/energy_released = 0
var/energy_released = 0
var/old_heat_capacity = heat_capacity()
var/datum/gas/volatile_fuel/fuel_store = locate(/datum/gas/volatile_fuel) in trace_gases
@@ -1006,6 +1007,18 @@ What are the archived variables for?
return 0
return 1
/datum/gas_mixture/proc/compare_unsim(turf/list/samples)
//Purpose: Compares a list of unsimulated tiles to self to see if within acceptable ranges that group processing may be enabled
//Called by: ZAS sleeping detection.
//Inputs: List of unsimulated turfs to compare to
//Outputs: 1 if within an acceptable range to sleep, 0 otherwise.
var/datum/gas_mixture/after_share = new
after_share.copy_from(src)
ShareSpace(after_share, samples)
return src.compare(after_share)
/datum/gas_mixture/proc/subtract(datum/gas_mixture/right_side)
//Purpose: Subtracts right_side from air_mixture. Used to help turfs mingle
//Called by: Pipelines ending in a break (or something)

View File

@@ -50,12 +50,8 @@ Important Procedures
air_master.process()
This first processes the air_master update/rebuild lists then processes all groups and tiles for air calculations
*/
#define ZONE_ACTIVE 1
#define ZONE_SLEEPING 0
var/tick_multiplier = 2
atom/proc/CanPass(atom/movable/mover, turf/target, height=1.5, air_group = 0)

View File

@@ -11,6 +11,8 @@ Attach to transfer valve and open. BOOM.
*/
//Some legacy definitions so fires can be started.
atom/proc/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
return null
@@ -19,145 +21,160 @@ atom/proc/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed
turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0)
turf/simulated/hotspot_expose(exposed_temperature, exposed_volume, soh)
if(fire_protection > world.time-300)
if(fire_protection > world.time-300) return
var/datum/gas_mixture/air_contents = return_air(1)
if(!air_contents)
return 0
/*if(active_hotspot)
if(soh)
if(air_contents.toxins > 0.5 && air_contents.oxygen > 0.5)
if(active_hotspot.temperature < exposed_temperature)
active_hotspot.temperature = exposed_temperature
if(active_hotspot.volume < exposed_volume)
active_hotspot.volume = exposed_volume
return 1*/
var/igniting = 0
if(locate(/obj/fire) in src)
return 1
var/datum/gas_mixture/air_contents = return_air()
if(!air_contents || exposed_temperature < PLASMA_MINIMUM_BURN_TEMPERATURE)
return 0
var/igniting = 0
var/datum/gas/volatile_fuel/fuel = locate() in air_contents.trace_gases
var/obj/effect/decal/cleanable/liquid_fuel/liquid = locate() in src
if(air_contents.check_combustability(liquid))
if(air_contents.calculate_firelevel(liquid) > vsc.IgnitionLevel && (fuel || liquid || air_contents.toxins > 0.5))
igniting = 1
if(air_contents.oxygen < 0.5)
return 0
if(! (locate(/obj/fire) in src))
new /obj/fire(src,1000)
var/obj/fire/F = new(src,1000)
F.temperature = exposed_temperature
F.volume = CELL_VOLUME
//active_hotspot.just_spawned = (current_cycle < air_master.current_cycle)
//remove just_spawned protection if no longer processing this cell
return igniting
/obj/fire
//Icon for fire on turfs.
obj
fire
//Icon for fire on turfs.
anchored = 1
mouse_opacity = 0
anchored = 1
mouse_opacity = 0
//luminosity = 3
//luminosity = 3
icon = 'icons/effects/fire.dmi'
icon_state = "1"
layer = TURF_LAYER
var/firelevel = 10000 //Calculated by gas_mixture.calculate_firelevel()
/obj/fire/process()
. = 1
//get location and check if it is in a proper ZAS zone
var/turf/simulated/floor/S = loc
if(!S.zone)
del src
if(!istype(S))
del src
var/datum/gas_mixture/air_contents = S.return_air()
//get liquid fuels on the ground.
var/obj/effect/decal/cleanable/liquid_fuel/liquid = locate() in S
//and the volatile stuff from the air
//var/datum/gas/volatile_fuel/fuel = locate() in air_contents.trace_gases
//check if there is something to combust
if(!air_contents.check_combustability(liquid))
del src
//get a firelevel and set the icon
firelevel = air_contents.calculate_firelevel(liquid)
if(firelevel > 6)
icon_state = "3"
SetLuminosity(7)
else if(firelevel > 2.5)
icon_state = "2"
SetLuminosity(5)
else
icon = 'icons/effects/fire.dmi'
icon_state = "1"
SetLuminosity(3)
//im not sure how to implement a version that works for every creature so for now monkeys are firesafe
for(var/mob/living/carbon/human/M in loc)
M.FireBurn(firelevel, air_contents.temperature, air_contents.return_pressure() ) //Burn the humans!
var
volume = CELL_VOLUME
temperature = PLASMA_MINIMUM_BURN_TEMPERATURE
firelevel = 10000 //Calculated by gas_mixture.calculate_firelevel()
archived_firelevel = 0
process()
. = 1
if(firelevel > vsc.IgnitionLevel)
var/turf/simulated/floor/S = loc
if(!S.zone) del src //Cannot exist where zones are broken.
if(istype(S))
var
datum/gas_mixture/air_contents = S.return_air()
//Get whatever trace fuels are in the area
datum/gas/volatile_fuel/fuel = locate() in air_contents.trace_gases
//Also get liquid fuels on the ground.
obj/effect/decal/cleanable/liquid_fuel/liquid = locate() in S
var/datum/gas_mixture/flow = air_contents.remove_ratio(0.25)
//The reason we're taking a part of the air instead of all of it is so that it doesn't jump to
//the fire's max temperature instantaneously.
firelevel = air_contents.calculate_firelevel(liquid)
//Ensure that there is an appropriate amount of fuel and O2 here.
if(firelevel > 0.25 && flow.oxygen > 0.3 && (air_contents.toxins || fuel || liquid))
for(var/direction in cardinal)
if(S.air_check_directions&direction) //Grab all valid bordering tiles
var/turf/simulated/enemy_tile = get_step(S, direction)
if(istype(enemy_tile))
//If extinguisher mist passed over the turf it's trying to spread to, don't spread and
//reduce firelevel.
if(enemy_tile.fire_protection > world.time-30)
firelevel -= 1.5
continue
//Spread the fire.
if(!(locate(/obj/fire) in enemy_tile))
if( prob( firelevel*10 ) && S.CanPass(null, enemy_tile, 0,0) && enemy_tile.CanPass(null, S, 0,0))
new/obj/fire(enemy_tile,firelevel)
if(flow)
//Ensure adequate oxygen and fuel.
if(flow.oxygen > 0.3 && (flow.toxins || fuel || liquid))
//Change icon depending on the fuel, and thus temperature.
if(firelevel > 6)
icon_state = "3"
else if(firelevel > 2.5)
icon_state = "2"
else
icon_state = "1"
//Ensure flow temperature is higher than minimum fire temperatures.
flow.temperature = max(PLASMA_MINIMUM_BURN_TEMPERATURE+0.1,flow.temperature)
//Burn the gas mixture.
flow.zburn(liquid)
if(fuel && fuel.moles <= 0.00001)
del fuel
else
del src
//spread!
for(var/direction in cardinal)
if(S.air_check_directions&direction) //Grab all valid bordering tiles
S.assume_air(flow) //Then put it back where you found it.
var/turf/simulated/enemy_tile = get_step(S, direction)
if(istype(enemy_tile))
//If extinguisher mist passed over the turf it's trying to spread to, don't spread and
//reduce firelevel.
if(enemy_tile.fire_protection > world.time-30)
firelevel -= 1.5
continue
//Spread the fire.
if(!(locate(/obj/fire) in enemy_tile))
if( prob( 50 + 50 * (firelevel/vsc.fire_firelevel_multiplier) ) && S.CanPass(null, enemy_tile, 0,0) && enemy_tile.CanPass(null, S, 0,0))
new/obj/fire(enemy_tile,firelevel)
//seperate part of the present gas
//this is done to prevent the fire burning all gases in a single pass
var/datum/gas_mixture/flow = air_contents.remove_ratio(vsc.fire_consuption_rate)
///////////////////////////////// FLOW HAS BEEN CREATED /// DONT DELETE THE FIRE UNTIL IT IS MERGED BACK OR YOU WILL DELETE AIR ///////////////////////////////////////////////
if(flow)
if(flow.check_combustability(liquid))
//Ensure flow temperature is higher than minimum fire temperatures.
//this creates some energy ex nihilo but is necessary to get a fire started
//lets just pretend this energy comes from the ignition source and dont mention this again
//flow.temperature = max(PLASMA_MINIMUM_BURN_TEMPERATURE+0.1,flow.temperature)
//burn baby burn!
flow.zburn(liquid,1)
//merge the air back
S.assume_air(flow)
///////////////////////////////// FLOW HAS BEEN REMERGED /// feel free to delete the fire again from here on //////////////////////////////////////////////////////////////////
else
del src
else
del src
else
del src
/obj/fire/New(newLoc,fl)
..()
if(!istype(loc, /turf))
del src
dir = pick(cardinal)
SetLuminosity(3)
firelevel = fl
air_master.active_hotspots.Add(src)
for(var/mob/living/carbon/human/M in loc)
M.FireBurn(temperature, min(max(0.1,firelevel / 20),10)) //Burn the humans!
/obj/fire/Del()
if (istype(loc, /turf/simulated))
SetLuminosity(0)
New(newLoc,fl)
..()
loc = null
air_master.active_hotspots.Remove(src)
if(!istype(loc, /turf))
del src
..()
dir = pick(cardinal)
//sd_SetLuminosity(3,2,0)
firelevel = fl
air_master.active_hotspots.Add(src)
Del()
if (istype(loc, /turf/simulated))
//sd_SetLuminosity(0)
loc = null
air_master.active_hotspots.Remove(src)
..()
turf/simulated/var/fire_protection = 0 //Protects newly extinguished tiles from being overrun again.
@@ -165,19 +182,22 @@ turf/proc/apply_fire_protection()
turf/simulated/apply_fire_protection()
fire_protection = world.time
datum/gas_mixture/proc/zburn(obj/effect/decal/cleanable/liquid_fuel/liquid)
//This proc is similar to fire(), but uses a simple logarithm to calculate temp, and is thus more stable with ZAS.
datum/gas_mixture/proc/zburn(obj/effect/decal/cleanable/liquid_fuel/liquid,force_burn)
var/value = 0
if(temperature > PLASMA_FLASHPOINT && !reacting)
reacting = 1
if((temperature > PLASMA_MINIMUM_BURN_TEMPERATURE || force_burn) && check_combustability(liquid) )
var/total_fuel = 0
var/datum/gas/volatile_fuel/fuel = locate() in trace_gases
total_fuel += toxins
if(temperature > PLASMA_MINIMUM_BURN_TEMPERATURE && reacting)
var
total_fuel = toxins
fuel_sources = 0 //We'll divide by this later so that fuel is consumed evenly.
datum/gas/volatile_fuel/fuel = locate() in trace_gases
if(fuel)
//Volatile Fuel
total_fuel += fuel.moles
fuel_sources++
if(liquid)
//Liquid Fuel
@@ -185,94 +205,65 @@ datum/gas_mixture/proc/zburn(obj/effect/decal/cleanable/liquid_fuel/liquid,force
del liquid
else
total_fuel += liquid.amount
fuel_sources++
//Calculate the firelevel.
var/firelevel = calculate_firelevel(liquid)
//Toxins
if(toxins > 0.3) fuel_sources++
//get the current inner energy of the gas mix
//this must be taken here to prevent the addition or deletion of energy by a changing heat capacity
var/starting_energy = temperature * heat_capacity()
if(!fuel_sources) return 0 //If there's no fuel, there's no burn. Can't divide by zero anyway.
//determine the amount of oxygen used
var/total_oxygen = min(oxygen, 2 * total_fuel)
if(oxygen > 0.3)
//determine the amount of fuel actually used
var/used_fuel_ratio = min(oxygen / 2 , total_fuel) / total_fuel
total_fuel = total_fuel * used_fuel_ratio
//Calculate the firelevel.
var/firelevel = calculate_firelevel(liquid)
var/total_reactants = total_fuel + total_oxygen
//Reaches a maximum practical temperature of around 4500.
//determine the amount of reactants actually reacting
var/used_reactants_ratio = min( max(total_reactants * firelevel / vsc.fire_firelevel_multiplier, 0.2), total_reactants) / total_reactants
//Increase temperature.
temperature = max( 1700*log(0.4*firelevel + 1.23) , temperature )
//remove and add gasses as calculated
oxygen -= min(oxygen, total_oxygen * used_reactants_ratio )
//Consume some gas.
var/consumed_gas = min(oxygen,0.05*firelevel,total_fuel) / fuel_sources
toxins -= min(toxins, toxins * used_fuel_ratio * used_reactants_ratio )
oxygen = max(0,oxygen-consumed_gas)
carbon_dioxide += max(2 * total_fuel, 0)
toxins = max(0,toxins-consumed_gas)
if(fuel)
fuel.moles -= fuel.moles * used_fuel_ratio * used_reactants_ratio
if(fuel.moles <= 0) del fuel
carbon_dioxide += consumed_gas*2
if(liquid)
liquid.amount -= liquid.amount * used_fuel_ratio * used_reactants_ratio
if(liquid.amount <= 0) del liquid
if(fuel)
fuel.moles -= consumed_gas
if(fuel.moles <= 0) del fuel
//calculate the energy produced by the reaction and then set the new temperature of the mix
temperature = (starting_energy + vsc.fire_fuel_energy_release * total_fuel) / heat_capacity()
if(liquid)
liquid.amount -= consumed_gas
if(liquid.amount <= 0) del liquid
update_values()
value = total_reactants * used_reactants_ratio
return value
update_values()
return consumed_gas*fuel_sources
datum/gas_mixture/proc/check_combustability(obj/effect/decal/cleanable/liquid_fuel/liquid)
//this check comes up very often and is thus centralized here to ease adding stuff
else
reacting = 0
var/datum/gas/volatile_fuel/fuel = locate() in trace_gases
var/value = 0
return 0
if(oxygen > 0.01 && (toxins > 0.01 || (fuel && fuel.moles > 0.01) || liquid))
value = 1
return value
datum/gas_mixture/proc/calculate_firelevel(obj/effect/decal/cleanable/liquid_fuel/liquid)
//Calculates the firelevel based on one equation instead of having to do this multiple times in different areas.
//Calculates the firelevel based on one equation instead of having to do this multiple times in different areas.
var
datum/gas/volatile_fuel/fuel = locate() in trace_gases
liquid_concentration = 0
var/datum/gas/volatile_fuel/fuel = locate() in trace_gases
var/total_fuel = 0
var/firelevel = 0
oxy_concentration = oxygen / volume
tox_concentration = toxins / volume
fuel_concentration = 0
if(check_combustability(liquid))
if(fuel) fuel_concentration = (fuel.moles) / volume
if(liquid) liquid_concentration = (liquid.amount*15) / volume
return (oxy_concentration + tox_concentration + liquid_concentration + fuel_concentration)*100
total_fuel += toxins
if(liquid)
total_fuel += liquid.amount
if(fuel)
total_fuel += fuel.moles
var/total_combustables = (total_fuel + oxygen)
if(total_fuel > 0 && oxygen > 0)
//slows down the burning when the concentration of the reactants is low
var/dampening_multiplier = total_combustables / (total_combustables + nitrogen + carbon_dioxide)
//calculates how close the mixture of the reactants is to the optimum
var/mix_multiplier = 1 / (1 + (5 * ((oxygen / total_combustables) ** 2)))
//toss everything together
firelevel = vsc.fire_firelevel_multiplier * mix_multiplier * dampening_multiplier
return max( 0, firelevel)
/mob/living/carbon/human/proc/FireBurn(var/firelevel, var/last_temperature, var/pressure)
// mostly using the old proc from Sky until I can think of something better
/mob/living/carbon/human/proc/FireBurn(last_temperature, mx as num)
//Burns mobs due to fire. Respects heat transfer coefficients on various body parts.
//Due to TG reworking how fireprotection works, this is kinda less meaningful.
var
head_exposure = 1
@@ -281,12 +272,8 @@ datum/gas_mixture/proc/calculate_firelevel(obj/effect/decal/cleanable/liquid_fue
legs_exposure = 1
arms_exposure = 1
//determine the multiplier
//minimize this for low-pressure enviroments
var/mx = 5 * firelevel/vsc.fire_firelevel_multiplier * min(pressure / ONE_ATMOSPHERE, 1)
//Get heat transfer coefficients for clothing.
//skytodo: kill anyone who breaks things then orders me to fix them
for(var/obj/item/clothing/C in src)
if(l_hand == C || r_hand == C)
continue
@@ -313,4 +300,4 @@ datum/gas_mixture/proc/calculate_firelevel(obj/effect/decal/cleanable/liquid_fue
apply_damage(0.4*mx*arms_exposure, BURN, "l_arm", 0, 0, "Fire")
apply_damage(0.4*mx*arms_exposure, BURN, "r_arm", 0, 0, "Fire")
//flash_pain()
//flash_pain()

View File

@@ -1,7 +1,7 @@
var/global/vs_control/vsc = new
/vs_control
var/fire_consuption_rate = 0.25
/* var/fire_consuption_rate = 0.25
var/fire_consuption_rate_NAME = "Fire - Air Consumption Ratio"
var/fire_consuption_rate_DESC = "Ratio of air removed and combusted per tick."
@@ -12,7 +12,10 @@ var/global/vs_control/vsc = new
var/fire_fuel_energy_release = 397000
var/fire_fuel_energy_release_NAME = "Fire - Fuel energy release"
var/fire_fuel_energy_release_DESC = "The energy in joule released when burning one mol of a burnable substance"
*/
var/IgnitionLevel = 0.5
var/IgnitionLevel_DESC = "Determines point at which fire can ignite"
var/airflow_lightest_pressure = 20
var/airflow_lightest_pressure_NAME = "Airflow - Small Movement Threshold %"

View File

@@ -43,6 +43,8 @@
/turf/simulated/var/tmp/air_check_directions = 0 //Do not modify this, just add turf to air_master.tiles_to_update
/turf/simulated/var/tmp/unsim_check_directions = 0 //See above.
/turf/simulated/var/tmp/obj/fire/active_hotspot
/turf/simulated/proc/update_visuals()
@@ -128,9 +130,16 @@
var/air_directions_archived = air_check_directions
air_check_directions = 0
var/unsim_directions_archived = unsim_check_directions
unsim_check_directions = 0
for(var/direction in cardinal)
if(ZAirPass(get_step(src,direction)))
air_check_directions |= direction
var/turf/check_turf = get_step(src, direction)
if(ZAirPass(check_turf))
if(istype(check_turf, /turf/simulated))
air_check_directions |= direction
else if(istype(check_turf, /turf/space) || istype(check_turf, /turf/unsimulated))
unsim_check_directions |= direction
if(!zone && !blocks_air) //No zone, but not a wall.
for(var/direction in DoorDirections) //Check door directions first.
@@ -166,13 +175,16 @@
if(!istype(T))
continue
//I can connect to air in this direction
if(air_check_directions & direction && !(air_directions_archived & direction))
//I can connect to air or space in this direction
if((air_check_directions & direction && !(air_directions_archived & direction)) || \
(unsim_check_directions & direction && !(unsim_directions_archived & direction)))
ZConnect(src,T)
zone.ActivateIfNeeded()
if(T.zone) T.zone.ActivateIfNeeded()
//Something like a wall was built, changing the geometry.
else if(!(air_check_directions & direction) && air_directions_archived & direction)
else if((!(air_check_directions & direction) && air_directions_archived & direction) || \
(!(unsim_check_directions & direction) && unsim_directions_archived & direction))
var/turf/NT = get_step(T, direction)
//If the tile is in our own zone, and we cannot connect to it, better rebuild.

View File

@@ -21,6 +21,7 @@ var/list/CounterDoorDirections = list(SOUTH,EAST) //Which directions doors turfs
var/last_rebuilt = 0
var/status = ZONE_ACTIVE
var/interactions_with_neighbors = 0
var/interactions_with_unsim = 0
var/progress = "nothing"
@@ -185,10 +186,14 @@ var/list/CounterDoorDirections = list(SOUTH,EAST) //Which directions doors turfs
unsimulated_tiles -= T
if(unsimulated_tiles.len)
var/old_pressure = air.return_pressure()
var/moved_air = ShareSpace(air,unsimulated_tiles)
if(moved_air > vsc.airflow_lightest_pressure)
AirflowSpace(src)
if(old_pressure && (moved_air / old_pressure) > MINIMUM_AIR_RATIO_TO_SUSPEND) //Check if we've moved enough air to be considered awake.
interactions_with_unsim++
else
unsimulated_tiles = null
@@ -305,10 +310,11 @@ var/list/CounterDoorDirections = list(SOUTH,EAST) //Which directions doors turfs
Z.interactions_with_neighbors++
interactions_with_neighbors++
if(!interactions_with_neighbors && !unsimulated_tiles)
if(!interactions_with_neighbors && !interactions_with_unsim)
SetStatus(ZONE_SLEEPING)
interactions_with_neighbors = 0
interactions_with_unsim = 0
progress = "all components completed successfully, the problem is not here"
@@ -326,6 +332,31 @@ var/list/CounterDoorDirections = list(SOUTH,EAST) //Which directions doors turfs
archived_air.copy_from(air)
/zone/proc/CheckStatus()
return status
/zone/proc/ActivateIfNeeded()
if(status == ZONE_ACTIVE) return
var/difference = 0
if(unsimulated_tiles && unsimulated_tiles.len)
if(air.compare_unsim(unsimulated_tiles))
difference = 1
if(!difference)
for(var/zone/Z in connected_zones) //Check adjacent zones for air difference.
if(air.compare(Z.air))
difference = 1
break
if(difference) //We have a difference, activate the zone.
SetStatus(ZONE_ACTIVE)
return
/zone/proc/assume_air(var/datum/gas_mixture/giver)
if(status == ZONE_ACTIVE)
return air.merge(giver)

View File

@@ -281,46 +281,6 @@ proc/isInSight(var/atom/A, var/atom/B)
return M
return null
//i think this is used soley by verb/give(), cael
proc/check_can_reach(atom/user, atom/target)
if(!in_range(user,target))
return 0
return CanReachThrough(get_turf(user), get_turf(target), target)
//dummy caching, used to speed up reach checks
var/list/DummyCache = list()
/proc/CanReachThrough(turf/srcturf, turf/targetturf, atom/target)
var/obj/item/weapon/dummy/D = locate() in DummyCache
if(!D)
D = new /obj/item/weapon/dummy( srcturf )
else
DummyCache.Remove(D)
D.loc = srcturf
if(targetturf.density && targetturf != get_turf(target))
return 0
//Now, check objects to block exit that are on the border
for(var/obj/border_obstacle in srcturf)
if(border_obstacle.flags & ON_BORDER)
if(!border_obstacle.CheckExit(D, targetturf))
D.loc = null
DummyCache.Add(D)
return 0
//Next, check objects to block entry that are on the border
for(var/obj/border_obstacle in targetturf)
if((border_obstacle.flags & ON_BORDER) && (target != border_obstacle))
if(!border_obstacle.CanPass(D, srcturf, 1, 0))
D.loc = null
DummyCache.Add(D)
return 0
D.loc = null
DummyCache.Add(D)
return 1
// Will return a list of active candidates. It increases the buffer 5 times until it finds a candidate which is active within the buffer.
/proc/get_active_candidates(var/buffer = 1)

View File

@@ -290,6 +290,27 @@ proc/listclearnulls(list/list)
return (result + R.Copy(Ri, 0))
//Mergesort: any value in a list, preserves key=value structure
/proc/sortAssoc(var/list/L)
if(L.len < 2)
return L
var/middle = L.len / 2 + 1 // Copy is first,second-1
return mergeAssoc(sortAssoc(L.Copy(0,middle)), sortAssoc(L.Copy(middle))) //second parameter null = to end of list
/proc/mergeAssoc(var/list/L, var/list/R)
var/Li=1
var/Ri=1
var/list/result = new()
while(Li <= L.len && Ri <= R.len)
if(sorttext(L[Li], R[Ri]) < 1)
result += R&R[Ri++]
else
result += L&L[Li++]
if(Li <= L.len)
return (result + L.Copy(Li, 0))
return (result + R.Copy(Ri, 0))
//Converts a bitfield to a list of numbers (or words if a wordlist is provided)
/proc/bitfield2list(bitfield = 0, list/wordlist)
var/list/r = list()

124
code/_onclick/adjacent.dm Normal file
View File

@@ -0,0 +1,124 @@
/*
Adjacency proc for determining touch range
This is mostly to determine if a user can enter a square for the purposes of touching something.
Examples include reaching a square diagonally or reaching something on the other side of a glass window.
This is calculated by looking for border items, or in the case of clicking diagonally from yourself, dense items.
This proc will NOT notice if you are trying to attack a window on the other side of a dense object in its turf. There is a window helper for that.
Note that in all cases the neighbor is handled simply; this is usually the user's mob, in which case it is up to you
to check that the mob is not inside of something
*/
/atom/proc/Adjacent(var/atom/neighbor) // basic inheritance, unused
return 0
// Not a sane use of the function and (for now) indicative of an error elsewhere
/area/Adjacent(var/atom/neighbor)
CRASH("Call to /area/Adjacent(), unimplemented proc")
/*
Adjacency (to turf):
* If you are in the same turf, always true
* If you are vertically/horizontally adjacent, ensure there are no border objects
* If you are diagonally adjacent, ensure you can pass through at least one of the mutually adjacent square.
* Passing through in this case ignores anything with the throwpass flag, such as tables, racks, and morgue trays.
*/
/turf/Adjacent(var/atom/neighbor, var/atom/target = null)
var/turf/T0 = get_turf(neighbor)
if(T0 == src)
return 1
if(get_dist(src,T0) > 1)
return 0
if(T0.x == x || T0.y == y)
// Check for border blockages
return T0.ClickCross(get_dir(T0,src), border_only = 1) && src.ClickCross(get_dir(src,T0), border_only = 1, target_atom = target)
// Not orthagonal
var/in_dir = get_dir(neighbor,src) // eg. northwest (1+8)
var/d1 = in_dir&(in_dir-1) // eg west (1+8)&(8) = 8
var/d2 = in_dir - d1 // eg north (1+8) - 8 = 1
for(var/d in list(d1,d2))
if(!T0.ClickCross(d, border_only = 1))
continue // could not leave T0 in that direction
var/turf/T1 = get_step(T0,d)
if(!T1 || T1.density || !T1.ClickCross(get_dir(T1,T0) & get_dir(T1,src), border_only = 0))
continue // couldn't enter or couldn't leave T1
if(!src.ClickCross(get_dir(src,T1), border_only = 1, target_atom = target))
continue // could not enter src
return 1 // we don't care about our own density
return 0
/*
Adjacency (to anything else):
* Must be on a turf
* In the case of a multiple-tile object, all valid locations are checked for adjacency.
Note: Multiple-tile objects are created when the bound_width and bound_height are creater than the tile size.
This is not used in stock /tg/station currently.
*/
/atom/movable/Adjacent(var/atom/neighbor)
if(neighbor == loc) return 1
if(!isturf(loc)) return 0
for(var/turf/T in locs)
if(isnull(T)) continue
if(T.Adjacent(neighbor,src)) return 1
return 0
// This is necessary for storage items not on your person.
/obj/item/Adjacent(var/atom/neighbor, var/recurse = 1)
if(neighbor == loc) return 1
if(istype(loc,/obj/item))
if(recurse > 0)
return loc.Adjacent(neighbor,recurse - 1)
return 0
return ..()
/*
Special case: This allows you to reach a door when it is visally on top of,
but technically behind, a fire door
You could try to rewrite this to be faster, but I'm not sure anything would be.
This can be safely removed if border firedoors are ever moved to be on top of doors
so they can be interacted with without opening the door.
*/
/obj/machinery/door/Adjacent(var/atom/neighbor)
var/obj/machinery/door/firedoor/border_only/BOD = locate() in loc
if(BOD)
BOD.throwpass = 1 // allow click to pass
. = ..()
BOD.throwpass = 0
return .
return ..()
/*
This checks if you there is uninterrupted airspace between that turf and this one.
This is defined as any dense ON_BORDER object, or any dense object without throwpass.
The border_only flag allows you to not objects (for source and destination squares)
*/
/turf/proc/ClickCross(var/target_dir, var/border_only, var/target_atom = null)
for(var/obj/O in src)
if( !O.density || O == target_atom || O.throwpass) continue // throwpass is used for anything you can click through
if( O.flags&ON_BORDER) // windows have throwpass but are on border, check them first
if( O.dir & target_dir || O.dir&(O.dir-1) ) // full tile windows are just diagonals mechanically
return 0
else if( !border_only ) // dense, not on border, cannot pass over
return 0
return 1
/*
Aside: throwpass does not do what I thought it did originally, and is only used for checking whether or not
a thrown object should stop after already successfully entering a square. Currently the throw code involved
only seems to affect hitting mobs, because the checks performed against objects are already performed when
entering or leaving the square. Since throwpass isn't used on mobs, but only on objects, it is effectively
useless. Throwpass may later need to be removed and replaced with a passcheck (bitfield on movable atom passflags).
Since I don't want to complicate the click code rework by messing with unrelated systems it won't be changed here.
*/

125
code/_onclick/ai.dm Normal file
View File

@@ -0,0 +1,125 @@
/*
AI ClickOn()
Note currently ai restrained() returns 0 in all cases,
therefore restrained code has been removed
The AI can double click to move the camera (this was already true but is cleaner),
or double click a mob to track them.
Note that AI have no need for the adjacency proc, and so this proc is a lot cleaner.
*/
/mob/living/silicon/ai/DblClickOn(var/atom/A, params)
if(client.buildmode) // comes after object.Click to allow buildmode gui objects to be clicked
build_click(src, client.buildmode, params, A)
return
if(control_disabled || stat) return
next_move = world.time + 9
if(ismob(A))
ai_actual_track(A)
else
A.move_camera_by_click()
/mob/living/silicon/ai/ClickOn(var/atom/A, params)
if(world.time <= next_click)
return
next_click = world.time + 1
if(client.buildmode) // comes after object.Click to allow buildmode gui objects to be clicked
build_click(src, client.buildmode, params, A)
return
var/list/modifiers = params2list(params)
if(modifiers["middle"])
MiddleClickOn(A)
return
if(modifiers["shift"])
ShiftClickOn(A)
return
if(modifiers["alt"]) // alt and alt-gr (rightalt)
AltClickOn(A)
return
if(modifiers["ctrl"])
CtrlClickOn(A)
return
if(control_disabled || stat || world.time <= next_move) return
next_move = world.time + 9
/*
AI restrained() currently does nothing
if(restrained())
RestrainedClickOn(A)
else
*/
A.attack_ai(src)
/*
AI has no need for the UnarmedAttack() and RangedAttack() procs,
because the AI code is not generic; attack_ai() is used instead.
The below is only really for safety, or you can alter the way
it functions and re-insert it above.
*/
/mob/living/silicon/ai/UnarmedAttack(atom/A)
A.attack_ai(src)
/mob/living/silicon/ai/RangedAttack(atom/A)
A.attack_ai(src)
/atom/proc/attack_ai(mob/user as mob)
return
/*
Since the AI handles shift, ctrl, and alt-click differently
than anything else in the game, atoms have separate procs
for AI shift, ctrl, and alt clicking.
*/
/mob/living/silicon/ai/ShiftClickOn(var/atom/A)
A.AIShiftClick(src)
/mob/living/silicon/ai/CtrlClickOn(var/atom/A)
A.AICtrlClick(src)
/mob/living/silicon/ai/AltClickOn(var/atom/A)
A.AIAltClick(src)
/*
The following criminally helpful code is just the previous code cleaned up;
I have no idea why it was in atoms.dm instead of respective files.
*/
/atom/proc/AIShiftClick()
return
/obj/machinery/door/airlock/AIShiftClick() // Opens and closes doors!
if(density)
Topic("aiEnable=7", list("aiEnable"="7"), 1) // 1 meaning no window (consistency!)
else
Topic("aiDisable=7", list("aiDisable"="7"), 1)
return
/atom/proc/AICtrlClick()
return
/obj/machinery/door/airlock/AICtrlClick() // Bolts doors
if(locked)
Topic("aiEnable=4", list("aiEnable"="4"), 1)// 1 meaning no window (consistency!)
else
Topic("aiDisable=4", list("aiDisable"="4"), 1)
/obj/machinery/power/apc/AICtrlClick() // turns off APCs.
Topic("breaker=1", list("breaker"="1"), 0) // 0 meaning no window (consistency! wait...)
/atom/proc/AIAltClick()
return
/obj/machinery/door/airlock/AIAltClick() // Eletrifies doors.
if(!secondsElectrified)
// permenant shock
Topic("aiEnable=6", list("aiEnable"="6"), 1) // 1 meaning no window (consistency!)
else
// disable/6 is not in Topic; disable/5 disables both temporary and permenant shock
Topic("aiDisable=5", list("aiDisable"="5"), 1)
return

302
code/_onclick/click.dm Normal file
View File

@@ -0,0 +1,302 @@
/*
Click code cleanup
~Sayu
*/
// 1 decisecond click delay (above and beyond mob/next_move)
/mob/var/next_click = 0
/*
Before anything else, defer these calls to a per-mobtype handler. This allows us to
remove istype() spaghetti code, but requires the addition of other handler procs to simplify it.
Alternately, you could hardcode every mob's variation in a flat ClickOn() proc; however,
that's a lot of code duplication and is hard to maintain.
Note that this proc can be overridden, and is in the case of screen objects.
*/
/atom/Click(location,control,params)
usr.ClickOn(src, params)
/atom/DblClick(location,control,params)
usr.DblClickOn(src,params)
/*
Standard mob ClickOn()
Handles exceptions: Buildmode, middle click, modified clicks, mech actions
After that, mostly just check your state, check whether you're holding an item,
check whether you're adjacent to the target, then pass off the click to whoever
is recieving it.
The most common are:
* mob/UnarmedAttack(atom,adjacent) - used here only when adjacent, with no item in hand; in the case of humans, checks gloves
* atom/attackby(item,user) - used only when adjacent
* item/afterattack(atom,user,adjacent,params) - used both ranged and adjacent
* mob/RangedAttack(atom,params) - used only ranged, only used for tk and laser eyes but could be changed
*/
/mob/proc/ClickOn( var/atom/A, var/params )
if(world.time <= next_click)
return
next_click = world.time + 1
if(client.buildmode)
build_click(src, client.buildmode, params, A)
return
var/list/modifiers = params2list(params)
if(modifiers["middle"])
MiddleClickOn(A)
return
if(modifiers["shift"])
ShiftClickOn(A)
return
if(modifiers["alt"]) // alt and alt-gr (rightalt)
AltClickOn(A)
return
if(modifiers["ctrl"])
CtrlClickOn(A)
return
if(stat || paralysis || stunned || weakened)
return
face_atom(A) // change direction to face what you clicked on
if(next_move > world.time) // in the year 2000...
return
if(istype(loc,/obj/mecha))
var/obj/mecha/M = loc
return M.click_action(A,src)
if(restrained())
RestrainedClickOn(A)
return
if(in_throw_mode)
throw_item(A)
return
var/obj/item/W = get_active_hand()
if(W == A)
next_move = world.time + 6
if(W.flags&USEDELAY)
next_move += 5
W.attack_self(src)
if(hand)
update_inv_l_hand(0)
else
update_inv_r_hand(0)
return
// operate two levels deep here (item in backpack in src; NOT item in box in backpack in src)
if(A == loc || (A in loc) || (A in contents) || (A.loc in contents))
// faster access to objects already on you
if(A in contents)
next_move = world.time + 6 // on your person
else
next_move = world.time + 8 // in a box/bag or in your square
// No adjacency needed
if(W)
if(W.flags&USEDELAY)
next_move += 5
var/resolved = A.attackby(W,src)
if(!resolved && A && W)
W.afterattack(A,src,1,params) // 1 indicates adjacency
else
UnarmedAttack(A)
return
if(!isturf(loc)) // This is going to stop you from telekinesing from inside a closet, but I don't shed many tears for that
return
// Allows you to click on a box's contents, if that box is on the ground, but no deeper than that
if(isturf(A) || isturf(A.loc) || (A.loc && isturf(A.loc.loc)))
next_move = world.time + 10
if(A.Adjacent(src)) // see adjacent.dm
if(W)
if(W.flags&USEDELAY)
next_move += 5
// Return 1 in attackby() to prevent afterattack() effects (when safely moving items for example)
var/resolved = A.attackby(W,src)
if(!resolved && A && W)
W.afterattack(A,src,1,params) // 1: clicking something Adjacent
else
UnarmedAttack(A, 1)
return
else // non-adjacent click
if(W)
W.afterattack(A,src,0,params) // 0: not Adjacent
else
RangedAttack(A, params)
return
// Default behavior: ignore double clicks, consider them normal clicks instead
/mob/proc/DblClickOn(var/atom/A, var/params)
ClickOn(A,params)
/*
Translates into attack_hand, etc.
Note: proximity_flag here is used to distinguish between normal usage (flag=1),
and usage when clicking on things telekinetically (flag=0). This proc will
not be called at ranged except with telekinesis.
proximity_flag is not currently passed to attack_hand, and is instead used
in human click code to allow glove touches only at melee range.
*/
/mob/proc/UnarmedAttack(var/atom/A, var/proximity_flag)
return
/*
Ranged unarmed attack:
This currently is just a default for all mobs, involving
laser eyes and telekinesis. You could easily add exceptions
for things like ranged glove touches, spitting alien acid/neurotoxin,
animals lunging, etc.
*/
/mob/proc/RangedAttack(var/atom/A, var/params)
if(!mutations.len) return
if((LASER in mutations) && a_intent == "harm")
LaserEyes(A) // moved into a proc below
else if(TK in mutations)
switch(get_dist(src,A))
if(0)
;
if(1 to 5) // not adjacent may mean blocked by window
next_move += 2
if(5 to 7)
next_move += 5
if(8 to tk_maxrange)
next_move += 10
else
return
A.attack_tk(src)
/*
Restrained ClickOn
Used when you are handcuffed and click things.
Not currently used by anything but could easily be.
*/
/mob/proc/RestrainedClickOn(var/atom/A)
return
/*
Middle click
Only used for swapping hands
*/
/mob/proc/MiddleClickOn(var/atom/A)
return
/mob/living/carbon/MiddleClickOn(var/atom/A)
swap_hand()
// In case of use break glass
/*
/atom/proc/MiddleClick(var/mob/M as mob)
return
*/
/*
Shift click
For most mobs, examine.
This is overridden in ai.dm
*/
/mob/proc/ShiftClickOn(var/atom/A)
A.ShiftClick(src)
return
/atom/proc/ShiftClick(var/mob/user)
if(user.client && user.client.eye == user)
examine()
user.face_atom(src)
return
/*
Ctrl click
For most objects, pull
*/
/mob/proc/CtrlClickOn(var/atom/A)
A.CtrlClick(src)
return
/atom/proc/CtrlClick(var/mob/user)
return
/atom/movable/CtrlClick(var/mob/user)
if(Adjacent(user))
user.start_pulling(src)
/*
Alt click
Unused except for AI
*/
/mob/proc/AltClickOn(var/atom/A)
A.AltClick(src)
return
/atom/proc/AltClick(var/mob/user)
var/turf/T = get_turf(src)
if(T && T.Adjacent(user))
if(user.listed_turf == T)
user.listed_turf = null
else
user.listed_turf = T
user.client.statpanel = T.name
return
/*
Misc helpers
Laser Eyes: as the name implies, handles this since nothing else does currently
face_atom: turns the mob towards what you clicked on
*/
/mob/proc/LaserEyes(atom/A)
return
/mob/living/LaserEyes(atom/A)
next_move = world.time + 6
var/turf/T = get_turf(src)
var/turf/U = get_turf(A)
var/obj/item/projectile/beam/LE = new /obj/item/projectile/beam( loc )
LE.icon = 'icons/effects/genetics.dmi'
LE.icon_state = "eyelasers"
playsound(usr.loc, 'sound/weapons/taser2.ogg', 75, 1)
LE.firer = src
LE.def_zone = get_organ_target()
LE.original = A
LE.current = T
LE.yo = U.y - T.y
LE.xo = U.x - T.x
spawn( 1 )
LE.process()
/mob/living/carbon/human/LaserEyes()
if(nutrition>0)
..()
nutrition = max(nutrition - rand(1,5),0)
handle_regular_hud_updates()
else
src << "\red You're out of energy! You need food!"
// Simple helper to face what you clicked on, in case it should be needed in more than one place
/mob/proc/face_atom(var/atom/A)
if( buckled || !A || !x || !y || !A.x || !A.y ) return
var/dx = A.x - x
var/dy = A.y - y
if(!dx && !dy) return
if(abs(dx) < abs(dy))
if(dy > 0) usr.dir = NORTH
else usr.dir = SOUTH
else
if(dx > 0) usr.dir = EAST
else usr.dir = WEST

118
code/_onclick/cyborg.dm Normal file
View File

@@ -0,0 +1,118 @@
/*
Cyborg ClickOn()
Cyborgs have no range restriction on attack_robot(), because it is basically an AI click.
However, they do have a range restriction on item use, so they cannot do without the
adjacency code.
*/
/mob/living/silicon/robot/ClickOn(var/atom/A, var/params)
if(world.time <= next_click)
return
next_click = world.time + 1
if(client.buildmode) // comes after object.Click to allow buildmode gui objects to be clicked
build_click(src, client.buildmode, params, A)
return
var/list/modifiers = params2list(params)
if(modifiers["middle"])
MiddleClickOn(A)
return
if(modifiers["shift"])
ShiftClickOn(A)
return
if(modifiers["alt"]) // alt and alt-gr (rightalt)
AltClickOn(A)
return
if(modifiers["ctrl"])
CtrlClickOn(A)
return
if(stat || lockcharge || weakened || stunned || paralysis)
return
if(next_move >= world.time)
return
face_atom(A) // change direction to face what you clicked on
/*
cyborg restrained() currently does nothing
if(restrained())
RestrainedClickOn(A)
return
*/
var/obj/item/W = get_active_hand()
// Cyborgs have no range-checking unless there is item use
if(!W)
A.attack_robot(src)
return
// buckled cannot prevent machine interlinking but stops arm movement
if( buckled )
return
if(W == A)
next_move = world.time + 8
if(W.flags&USEDELAY)
next_move += 5
W.attack_self(src)
return
// cyborgs are prohibited from using storage items so we can I think safely remove (A.loc in contents)
if(A == loc || (A in loc) || (A in contents))
// No adjacency checks
next_move = world.time + 8
if(W.flags&USEDELAY)
next_move += 5
var/resolved = A.attackby(W,src)
if(!resolved && A && W)
W.afterattack(A,src,1,params)
return
if(!isturf(loc))
return
// cyborgs are prohibited from using storage items so we can I think safely remove (A.loc && isturf(A.loc.loc))
if(isturf(A) || isturf(A.loc))
if(A.Adjacent(src)) // see adjacent.dm
next_move = world.time + 10
if(W.flags&USEDELAY)
next_move += 5
var/resolved = A.attackby(W, src)
if(!resolved && A && W)
W.afterattack(A, src, 1, params)
return
else
next_move = world.time + 10
W.afterattack(A, src, 0, params)
return
return
//Middle click cycles through selected modules.
/mob/living/silicon/robot/MiddleClickOn(var/atom/A)
cycle_modules()
return
/*
As with AI, these are not used in click code,
because the code for robots is specific, not generic.
If you would like to add advanced features to robot
clicks, you can do so here, but you will have to
change attack_robot() above to the proper function
*/
/mob/living/silicon/robot/UnarmedAttack(atom/A)
A.attack_robot(src)
/mob/living/silicon/robot/RangedAttack(atom/A)
A.attack_robot(src)
/atom/proc/attack_robot(mob/user as mob)
attack_ai(user)
return

View File

@@ -0,0 +1,18 @@
/*
MouseDrop:
Called on the atom you're dragging. In a lot of circumstances we want to use the
recieving object instead, so that's the default action. This allows you to drag
almost anything into a trash can.
*/
/atom/MouseDrop(atom/over)
if(!usr || !over) return
if(!Adjacent(usr) || !over.Adjacent(usr)) return // should stop you from dragging through windows
spawn(0)
over.MouseDrop_T(src,usr)
return
// recieve a mousedrop
/atom/proc/MouseDrop_T(atom/dropping, mob/user)
return

View File

@@ -0,0 +1,119 @@
/*
These defines specificy screen locations. For more information, see the byond documentation on the screen_loc var.
The short version:
Everything is encoded as strings because apparently that's how Byond rolls.
"1,1" is the bottom left square of the user's screen. This aligns perfectly with the turf grid.
"1:2,3:4" is the square (1,3) with pixel offsets (+2, +4); slightly right and slightly above the turf grid.
Pixel offsets are used so you don't perfectly hide the turf under them, that would be crappy.
The size of the user's screen is defined by client.view (indirectly by world.view), in our case "15x15".
Therefore, the top right corner (except during admin shenanigans) is at "15,15"
*/
//Upper left action buttons, displayed when you pick up an item that has this enabled.
#define ui_action_slot1 "1:6,14:26"
#define ui_action_slot2 "2:8,14:26"
#define ui_action_slot3 "3:10,14:26"
#define ui_action_slot4 "4:12,14:26"
#define ui_action_slot5 "5:14,14:26"
//Lower left, persistant menu
#define ui_inventory "1:6,1:5"
//Lower center, persistant menu
#define ui_sstore1 "3:10,1:5"
#define ui_id "4:12,1:5"
#define ui_belt "5:14,1:5"
#define ui_back "6:14,1:5"
#define ui_rhand "7:16,1:5"
#define ui_lhand "8:16,1:5"
#define ui_equip "7:16,2:5"
#define ui_swaphand1 "7:16,2:5"
#define ui_swaphand2 "8:16,2:5"
#define ui_storage1 "9:18,1:5"
#define ui_storage2 "10:20,1:5"
#define ui_alien_head "4:12,1:5" //aliens
#define ui_alien_oclothing "5:14,1:5" //aliens
#define ui_inv1 "6:16,1:5" //borgs
#define ui_inv2 "7:16,1:5" //borgs
#define ui_inv3 "8:16,1:5" //borgs
#define ui_borg_store "9:16,1:5" //borgs
#define ui_monkey_mask "5:14,1:5" //monkey
#define ui_monkey_back "6:14,1:5" //monkey
//Lower right, persistant menu
#define ui_dropbutton "11:22,1:5"
#define ui_drop_throw "14:28,2:7"
#define ui_pull_resist "13:26,2:7"
#define ui_acti "13:26,1:5"
#define ui_movi "12:24,1:5"
#define ui_zonesel "14:28,1:5"
#define ui_acti_alt "14:28,1:5" //alternative intent switcher for when the interface is hidden (F12)
#define ui_borg_pull "12:24,2:7"
#define ui_borg_module "13:26,2:7"
#define ui_borg_panel "14:28,2:7"
//Gun buttons
#define ui_gun1 "13:26,3:7"
#define ui_gun2 "14:28, 4:7"
#define ui_gun3 "13:26,4:7"
#define ui_gun_select "14:28,3:7"
//Upper-middle right (damage indicators)
#define ui_toxin "14:28,13:27"
#define ui_fire "14:28,12:25"
#define ui_oxygen "14:28,11:23"
#define ui_pressure "14:28,10:21"
#define ui_alien_toxin "14:28,13:25"
#define ui_alien_fire "14:28,12:25"
#define ui_alien_oxygen "14:28,11:25"
//Middle right (status indicators)
#define ui_nutrition "14:28,5:11"
#define ui_temp "14:28,6:13"
#define ui_health "14:28,7:15"
#define ui_internal "14:28,8:17"
//borgs
#define ui_borg_health "14:28,6:13" //borgs have the health display where humans have the pressure damage indicator.
#define ui_alien_health "14:28,6:13" //aliens have the health display where humans have the pressure damage indicator.
//Pop-up inventory
#define ui_shoes "2:8,1:5"
#define ui_iclothing "1:6,2:7"
#define ui_oclothing "2:8,2:7"
#define ui_gloves "3:10,2:7"
#define ui_glasses "1:6,3:9"
#define ui_mask "2:8,3:9"
#define ui_l_ear "3:10,3:9"
#define ui_r_ear "3:10,4:11"
#define ui_head "2:8,4:11"
//Intent small buttons
#define ui_help_small "12:8,1:1"
#define ui_disarm_small "12:15,1:18"
#define ui_grab_small "12:32,1:18"
#define ui_harm_small "12:39,1:1"
//#define ui_swapbutton "6:-16,1:5" //Unused
//#define ui_headset "SOUTH,8"
#define ui_hand "6:14,1:5"
#define ui_hstore1 "5,5"
//#define ui_resist "EAST+1,SOUTH-1"
#define ui_sleep "EAST+1, NORTH-13"
#define ui_rest "EAST+1, NORTH-14"
#define ui_iarrowleft "SOUTH-1,11"
#define ui_iarrowright "SOUTH-1,13"

View File

@@ -1,242 +1,241 @@
/datum/hud/proc/alien_hud()
src.adding = list( )
src.other = list( )
var/obj/screen/using
var/obj/screen/inventory/inv_box
using = new /obj/screen()
using.name = "act_intent"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent)
using.screen_loc = ui_acti
using.layer = 20
src.adding += using
action_intent = using
//intent small hud objects
var/icon/ico
ico = new('icons/mob/screen1_alien.dmi', "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
ico.DrawBox(rgb(255,255,255,1),1,ico.Height()/2,ico.Width()/2,ico.Height())
using = new /obj/screen( src )
using.name = "help"
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
help_intent = using
ico = new('icons/mob/screen1_alien.dmi', "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,ico.Height()/2,ico.Width(),ico.Height())
using = new /obj/screen( src )
using.name = "disarm"
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
disarm_intent = using
ico = new('icons/mob/screen1_alien.dmi', "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,1,ico.Width(),ico.Height()/2)
using = new /obj/screen( src )
using.name = "grab"
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
grab_intent = using
ico = new('icons/mob/screen1_alien.dmi', "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
ico.DrawBox(rgb(255,255,255,1),1,1,ico.Width()/2,ico.Height()/2)
using = new /obj/screen( src )
using.name = "harm"
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
hurt_intent = using
//end intent small hud objects
using = new /obj/screen()
using.name = "mov_intent"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
using.screen_loc = ui_movi
using.layer = 20
src.adding += using
move_intent = using
using = new /obj/screen()
using.name = "drop"
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "act_drop"
using.screen_loc = ui_drop_throw
using.layer = 19
src.adding += using
//equippable shit
//suit
inv_box = new /obj/screen/inventory()
inv_box.name = "o_clothing"
inv_box.dir = SOUTH
inv_box.icon = 'icons/mob/screen1_alien.dmi'
inv_box.icon_state = "equip"
inv_box.screen_loc = ui_alien_oclothing
inv_box.slot_id = slot_wear_suit
inv_box.layer = 19
src.adding += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "r_hand"
inv_box.dir = WEST
inv_box.icon = 'icons/mob/screen1_alien.dmi'
inv_box.icon_state = "hand_inactive"
if(mymob && !mymob.hand) //This being 0 or null means the right hand is in use
using.icon_state = "hand_active"
inv_box.screen_loc = ui_rhand
inv_box.layer = 19
src.r_hand_hud_object = inv_box
inv_box.slot_id = slot_r_hand
src.adding += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "l_hand"
inv_box.dir = EAST
inv_box.icon = 'icons/mob/screen1_alien.dmi'
inv_box.icon_state = "hand_inactive"
if(mymob && mymob.hand) //This being 1 means the left hand is in use
inv_box.icon_state = "hand_active"
inv_box.screen_loc = ui_lhand
inv_box.layer = 19
inv_box.slot_id = slot_l_hand
src.l_hand_hud_object = inv_box
src.adding += inv_box
using = new /obj/screen/inventory()
using.name = "hand"
using.dir = SOUTH
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "hand1"
using.screen_loc = ui_swaphand1
using.layer = 19
src.adding += using
using = new /obj/screen/inventory()
using.name = "hand"
using.dir = SOUTH
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "hand2"
using.screen_loc = ui_swaphand2
using.layer = 19
src.adding += using
//pocket 1
inv_box = new /obj/screen/inventory()
inv_box.name = "storage1"
inv_box.icon = 'icons/mob/screen1_alien.dmi'
inv_box.icon_state = "pocket"
inv_box.screen_loc = ui_storage1
inv_box.slot_id = slot_l_store
inv_box.layer = 19
src.adding += inv_box
//pocket 2
inv_box = new /obj/screen/inventory()
inv_box.name = "storage2"
inv_box.icon = 'icons/mob/screen1_alien.dmi'
inv_box.icon_state = "pocket"
inv_box.screen_loc = ui_storage2
inv_box.slot_id = slot_r_store
inv_box.layer = 19
src.adding += inv_box
//head
inv_box = new /obj/screen/inventory()
inv_box.name = "head"
inv_box.icon = 'icons/mob/screen1_alien.dmi'
inv_box.icon_state = "hair"
inv_box.screen_loc = ui_alien_head
inv_box.slot_id = slot_head
inv_box.layer = 19
src.adding += inv_box
//end of equippable shit
/*
using = new /obj/screen()
using.name = "resist"
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "act_resist"
using.screen_loc = ui_resist
using.layer = 19
src.adding += using
*/
mymob.throw_icon = new /obj/screen()
mymob.throw_icon.icon = 'icons/mob/screen1_alien.dmi'
mymob.throw_icon.icon_state = "act_throw_off"
mymob.throw_icon.name = "throw"
mymob.throw_icon.screen_loc = ui_drop_throw
mymob.oxygen = new /obj/screen()
mymob.oxygen.icon = 'icons/mob/screen1_alien.dmi'
mymob.oxygen.icon_state = "oxy0"
mymob.oxygen.name = "oxygen"
mymob.oxygen.screen_loc = ui_alien_oxygen
mymob.toxin = new /obj/screen()
mymob.toxin.icon = 'icons/mob/screen1_alien.dmi'
mymob.toxin.icon_state = "tox0"
mymob.toxin.name = "toxin"
mymob.toxin.screen_loc = ui_alien_toxin
mymob.fire = new /obj/screen()
mymob.fire.icon = 'icons/mob/screen1_alien.dmi'
mymob.fire.icon_state = "fire0"
mymob.fire.name = "fire"
mymob.fire.screen_loc = ui_alien_fire
mymob.healths = new /obj/screen()
mymob.healths.icon = 'icons/mob/screen1_alien.dmi'
mymob.healths.icon_state = "health0"
mymob.healths.name = "health"
mymob.healths.screen_loc = ui_alien_health
mymob.pullin = new /obj/screen()
mymob.pullin.icon = 'icons/mob/screen1_alien.dmi'
mymob.pullin.icon_state = "pull0"
mymob.pullin.name = "pull"
mymob.pullin.screen_loc = ui_pull_resist
mymob.blind = new /obj/screen()
mymob.blind.icon = 'icons/mob/screen1_full.dmi'
mymob.blind.icon_state = "blackimageoverlay"
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1"
mymob.blind.layer = 0
mymob.flash = new /obj/screen()
mymob.flash.icon = 'icons/mob/screen1_alien.dmi'
mymob.flash.icon_state = "blank"
mymob.flash.name = "flash"
mymob.flash.screen_loc = "1,1 to 15,15"
mymob.flash.layer = 17
mymob.zone_sel = new /obj/screen/zone_sel()
mymob.zone_sel.icon = 'icons/mob/screen1_alien.dmi'
mymob.zone_sel.overlays.Cut()
mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")
mymob.client.screen = null
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.toxin, mymob.fire, mymob.healths, mymob.pullin, mymob.blind, mymob.flash) //, mymob.hands, mymob.rest, mymob.sleep, mymob.mach )
mymob.client.screen += src.adding + src.other
/datum/hud/proc/alien_hud()
src.adding = list( )
src.other = list( )
var/obj/screen/using
var/obj/screen/inventory/inv_box
using = new /obj/screen()
using.name = "act_intent"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent)
using.screen_loc = ui_acti
using.layer = 20
src.adding += using
action_intent = using
//intent small hud objects
var/icon/ico
ico = new('icons/mob/screen1_alien.dmi', "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
ico.DrawBox(rgb(255,255,255,1),1,ico.Height()/2,ico.Width()/2,ico.Height())
using = new /obj/screen( src )
using.name = "help"
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
help_intent = using
ico = new('icons/mob/screen1_alien.dmi', "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,ico.Height()/2,ico.Width(),ico.Height())
using = new /obj/screen( src )
using.name = "disarm"
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
disarm_intent = using
ico = new('icons/mob/screen1_alien.dmi', "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,1,ico.Width(),ico.Height()/2)
using = new /obj/screen( src )
using.name = "grab"
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
grab_intent = using
ico = new('icons/mob/screen1_alien.dmi', "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
ico.DrawBox(rgb(255,255,255,1),1,1,ico.Width()/2,ico.Height()/2)
using = new /obj/screen( src )
using.name = "harm"
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
hurt_intent = using
//end intent small hud objects
using = new /obj/screen()
using.name = "mov_intent"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
using.screen_loc = ui_movi
using.layer = 20
src.adding += using
move_intent = using
using = new /obj/screen()
using.name = "drop"
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "act_drop"
using.screen_loc = ui_drop_throw
using.layer = 19
src.adding += using
//equippable shit
//suit
inv_box = new /obj/screen/inventory()
inv_box.name = "o_clothing"
inv_box.dir = SOUTH
inv_box.icon = 'icons/mob/screen1_alien.dmi'
inv_box.icon_state = "equip"
inv_box.screen_loc = ui_alien_oclothing
inv_box.slot_id = slot_wear_suit
inv_box.layer = 19
src.adding += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "r_hand"
inv_box.dir = WEST
inv_box.icon = 'icons/mob/screen1_alien.dmi'
inv_box.icon_state = "hand_inactive"
if(mymob && !mymob.hand) //This being 0 or null means the right hand is in use
using.icon_state = "hand_active"
inv_box.screen_loc = ui_rhand
inv_box.layer = 19
src.r_hand_hud_object = inv_box
inv_box.slot_id = slot_r_hand
src.adding += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "l_hand"
inv_box.dir = EAST
inv_box.icon = 'icons/mob/screen1_alien.dmi'
inv_box.icon_state = "hand_inactive"
if(mymob && mymob.hand) //This being 1 means the left hand is in use
inv_box.icon_state = "hand_active"
inv_box.screen_loc = ui_lhand
inv_box.layer = 19
inv_box.slot_id = slot_l_hand
src.l_hand_hud_object = inv_box
src.adding += inv_box
using = new /obj/screen/inventory()
using.name = "hand"
using.dir = SOUTH
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "hand1"
using.screen_loc = ui_swaphand1
using.layer = 19
src.adding += using
using = new /obj/screen/inventory()
using.name = "hand"
using.dir = SOUTH
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "hand2"
using.screen_loc = ui_swaphand2
using.layer = 19
src.adding += using
//pocket 1
inv_box = new /obj/screen/inventory()
inv_box.name = "storage1"
inv_box.icon = 'icons/mob/screen1_alien.dmi'
inv_box.icon_state = "pocket"
inv_box.screen_loc = ui_storage1
inv_box.slot_id = slot_l_store
inv_box.layer = 19
src.adding += inv_box
//pocket 2
inv_box = new /obj/screen/inventory()
inv_box.name = "storage2"
inv_box.icon = 'icons/mob/screen1_alien.dmi'
inv_box.icon_state = "pocket"
inv_box.screen_loc = ui_storage2
inv_box.slot_id = slot_r_store
inv_box.layer = 19
src.adding += inv_box
//head
inv_box = new /obj/screen/inventory()
inv_box.name = "head"
inv_box.icon = 'icons/mob/screen1_alien.dmi'
inv_box.icon_state = "hair"
inv_box.screen_loc = ui_alien_head
inv_box.slot_id = slot_head
inv_box.layer = 19
src.adding += inv_box
//end of equippable shit
/*
using = new /obj/screen()
using.name = "resist"
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = "act_resist"
using.screen_loc = ui_resist
using.layer = 19
src.adding += using
*/
mymob.throw_icon = new /obj/screen()
mymob.throw_icon.icon = 'icons/mob/screen1_alien.dmi'
mymob.throw_icon.icon_state = "act_throw_off"
mymob.throw_icon.name = "throw"
mymob.throw_icon.screen_loc = ui_drop_throw
mymob.oxygen = new /obj/screen()
mymob.oxygen.icon = 'icons/mob/screen1_alien.dmi'
mymob.oxygen.icon_state = "oxy0"
mymob.oxygen.name = "oxygen"
mymob.oxygen.screen_loc = ui_alien_oxygen
mymob.toxin = new /obj/screen()
mymob.toxin.icon = 'icons/mob/screen1_alien.dmi'
mymob.toxin.icon_state = "tox0"
mymob.toxin.name = "toxin"
mymob.toxin.screen_loc = ui_alien_toxin
mymob.fire = new /obj/screen()
mymob.fire.icon = 'icons/mob/screen1_alien.dmi'
mymob.fire.icon_state = "fire0"
mymob.fire.name = "fire"
mymob.fire.screen_loc = ui_alien_fire
mymob.healths = new /obj/screen()
mymob.healths.icon = 'icons/mob/screen1_alien.dmi'
mymob.healths.icon_state = "health0"
mymob.healths.name = "health"
mymob.healths.screen_loc = ui_alien_health
mymob.pullin = new /obj/screen()
mymob.pullin.icon = 'icons/mob/screen1_alien.dmi'
mymob.pullin.icon_state = "pull0"
mymob.pullin.name = "pull"
mymob.pullin.screen_loc = ui_pull_resist
mymob.blind = new /obj/screen()
mymob.blind.icon = 'icons/mob/screen1_full.dmi'
mymob.blind.icon_state = "blackimageoverlay"
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1"
mymob.blind.layer = 0
mymob.flash = new /obj/screen()
mymob.flash.icon = 'icons/mob/screen1_alien.dmi'
mymob.flash.icon_state = "blank"
mymob.flash.name = "flash"
mymob.flash.screen_loc = "1,1 to 15,15"
mymob.flash.layer = 17
mymob.zone_sel = new /obj/screen/zone_sel()
mymob.zone_sel.icon = 'icons/mob/screen1_alien.dmi'
mymob.zone_sel.overlays.Cut()
mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")
mymob.client.screen = null
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.toxin, mymob.fire, mymob.healths, mymob.pullin, mymob.blind, mymob.flash) //, mymob.hands, mymob.rest, mymob.sleep, mymob.mach )
mymob.client.screen += src.adding + src.other

View File

@@ -1,85 +1,81 @@
/datum/hud/proc/larva_hud()
src.adding = list()
src.other = list()
var/obj/screen/using
using = new /obj/screen()
using.name = "act_intent"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent)
using.screen_loc = ui_acti
using.layer = 20
src.adding += using
action_intent = using
using = new /obj/screen()
using.name = "mov_intent"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
using.screen_loc = ui_movi
using.layer = 20
src.adding += using
move_intent = using
mymob.oxygen = new /obj/screen()
mymob.oxygen.icon = 'icons/mob/screen1_alien.dmi'
mymob.oxygen.icon_state = "oxy0"
mymob.oxygen.name = "oxygen"
mymob.oxygen.screen_loc = ui_alien_oxygen
mymob.toxin = new /obj/screen()
mymob.toxin.icon = 'icons/mob/screen1_alien.dmi'
mymob.toxin.icon_state = "tox0"
mymob.toxin.name = "toxin"
mymob.toxin.screen_loc = ui_alien_toxin
mymob.fire = new /obj/screen()
mymob.fire.icon = 'icons/mob/screen1_alien.dmi'
mymob.fire.icon_state = "fire0"
mymob.fire.name = "fire"
mymob.fire.screen_loc = ui_alien_fire
mymob.healths = new /obj/screen()
mymob.healths.icon = 'icons/mob/screen1_alien.dmi'
mymob.healths.icon_state = "health0"
mymob.healths.name = "health"
mymob.healths.screen_loc = ui_alien_health
mymob.pullin = new /obj/screen()
mymob.pullin.icon = 'icons/mob/screen1_alien.dmi'
mymob.pullin.icon_state = "pull0"
mymob.pullin.name = "pull"
mymob.pullin.screen_loc = ui_pull_resist
mymob.blind = new /obj/screen()
mymob.blind.icon = 'icons/mob/screen1_full.dmi'
mymob.blind.icon_state = "blackimageoverlay"
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1"
mymob.blind.layer = 0
mymob.flash = new /obj/screen()
mymob.flash.icon = 'icons/mob/screen1_alien.dmi'
mymob.flash.icon_state = "blank"
mymob.flash.name = "flash"
mymob.flash.screen_loc = "1,1 to 15,15"
mymob.flash.layer = 17
mymob.zone_sel = new /obj/screen/zone_sel()
mymob.zone_sel.overlays.Cut()
mymob.zone_sel.overlays += image("icon" = 'icons/mob/zone_sel.dmi', "icon_state" = text("[]", mymob.zone_sel.selecting))
mymob.client.screen = null
mymob.client.screen += list( mymob.zone_sel, mymob.oxygen, mymob.toxin, mymob.fire, mymob.healths, mymob.pullin, mymob.blind, mymob.flash) //, mymob.rest, mymob.sleep, mymob.mach )
mymob.client.screen += src.adding + src.other
/datum/hud/proc/larva_hud()
src.adding = list()
src.other = list()
var/obj/screen/using
using = new /obj/screen()
using.name = "act_intent"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent)
using.screen_loc = ui_acti
using.layer = 20
src.adding += using
action_intent = using
using = new /obj/screen()
using.name = "mov_intent"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
using.screen_loc = ui_movi
using.layer = 20
src.adding += using
move_intent = using
mymob.oxygen = new /obj/screen()
mymob.oxygen.icon = 'icons/mob/screen1_alien.dmi'
mymob.oxygen.icon_state = "oxy0"
mymob.oxygen.name = "oxygen"
mymob.oxygen.screen_loc = ui_alien_oxygen
mymob.toxin = new /obj/screen()
mymob.toxin.icon = 'icons/mob/screen1_alien.dmi'
mymob.toxin.icon_state = "tox0"
mymob.toxin.name = "toxin"
mymob.toxin.screen_loc = ui_alien_toxin
mymob.fire = new /obj/screen()
mymob.fire.icon = 'icons/mob/screen1_alien.dmi'
mymob.fire.icon_state = "fire0"
mymob.fire.name = "fire"
mymob.fire.screen_loc = ui_alien_fire
mymob.healths = new /obj/screen()
mymob.healths.icon = 'icons/mob/screen1_alien.dmi'
mymob.healths.icon_state = "health0"
mymob.healths.name = "health"
mymob.healths.screen_loc = ui_alien_health
mymob.pullin = new /obj/screen()
mymob.pullin.icon = 'icons/mob/screen1_alien.dmi'
mymob.pullin.icon_state = "pull0"
mymob.pullin.name = "pull"
mymob.pullin.screen_loc = ui_pull_resist
mymob.blind = new /obj/screen()
mymob.blind.icon = 'icons/mob/screen1_full.dmi'
mymob.blind.icon_state = "blackimageoverlay"
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1"
mymob.blind.layer = 0
mymob.flash = new /obj/screen()
mymob.flash.icon = 'icons/mob/screen1_alien.dmi'
mymob.flash.icon_state = "blank"
mymob.flash.name = "flash"
mymob.flash.screen_loc = "1,1 to 15,15"
mymob.flash.layer = 17
mymob.zone_sel = new /obj/screen/zone_sel()
mymob.zone_sel.overlays.Cut()
mymob.zone_sel.overlays += image("icon" = 'icons/mob/zone_sel.dmi', "icon_state" = text("[]", mymob.zone_sel.selecting))
mymob.client.screen = null
mymob.client.screen += list( mymob.zone_sel, mymob.oxygen, mymob.toxin, mymob.fire, mymob.healths, mymob.pullin, mymob.blind, mymob.flash) //, mymob.rest, mymob.sleep, mymob.mach )
mymob.client.screen += src.adding + src.other

237
code/_onclick/hud/hud.dm Normal file
View File

@@ -0,0 +1,237 @@
/*
The global hud:
Uses the same visual objects for all players.
*/
var/datum/global_hud/global_hud = new()
/datum/hud/var/obj/screen/grab_intent
/datum/hud/var/obj/screen/hurt_intent
/datum/hud/var/obj/screen/disarm_intent
/datum/hud/var/obj/screen/help_intent
/datum/global_hud
var/obj/screen/druggy
var/obj/screen/blurry
var/list/vimpaired
var/list/darkMask
/datum/global_hud/New()
//420erryday psychedellic colours screen overlay for when you are high
druggy = new /obj/screen()
druggy.screen_loc = "WEST,SOUTH to EAST,NORTH"
druggy.icon_state = "druggy"
druggy.layer = 17
druggy.mouse_opacity = 0
//that white blurry effect you get when you eyes are damaged
blurry = new /obj/screen()
blurry.screen_loc = "WEST,SOUTH to EAST,NORTH"
blurry.icon_state = "blurry"
blurry.layer = 17
blurry.mouse_opacity = 0
var/obj/screen/O
var/i
//that nasty looking dither you get when you're short-sighted
vimpaired = newlist(/obj/screen,/obj/screen,/obj/screen,/obj/screen)
O = vimpaired[1]
O.screen_loc = "1,1 to 5,15"
O = vimpaired[2]
O.screen_loc = "5,1 to 10,5"
O = vimpaired[3]
O.screen_loc = "6,11 to 10,15"
O = vimpaired[4]
O.screen_loc = "11,1 to 15,15"
//welding mask overlay black/dither
darkMask = newlist(/obj/screen, /obj/screen, /obj/screen, /obj/screen, /obj/screen, /obj/screen, /obj/screen, /obj/screen)
O = darkMask[1]
O.screen_loc = "3,3 to 5,13"
O = darkMask[2]
O.screen_loc = "5,3 to 10,5"
O = darkMask[3]
O.screen_loc = "6,11 to 10,13"
O = darkMask[4]
O.screen_loc = "11,3 to 13,13"
O = darkMask[5]
O.screen_loc = "1,1 to 15,2"
O = darkMask[6]
O.screen_loc = "1,3 to 2,15"
O = darkMask[7]
O.screen_loc = "14,3 to 15,15"
O = darkMask[8]
O.screen_loc = "3,14 to 13,15"
for(i = 1, i <= 4, i++)
O = vimpaired[i]
O.icon_state = "dither50"
O.layer = 17
O.mouse_opacity = 0
O = darkMask[i]
O.icon_state = "dither50"
O.layer = 17
O.mouse_opacity = 0
for(i = 5, i <= 8, i++)
O = darkMask[i]
O.icon_state = "black"
O.layer = 17
O.mouse_opacity = 0
/*
The hud datum
Used to show and hide huds for all the different mob types,
including inventories and item quick actions.
*/
/datum/hud
var/mob/mymob
var/hud_shown = 1 //Used for the HUD toggle (F12)
var/inventory_shown = 1 //the inventory
var/show_intent_icons = 0
var/hotkey_ui_hidden = 0 //This is to hide the buttons that can be used via hotkeys. (hotkeybuttons list of buttons)
var/obj/screen/lingchemdisplay
var/obj/screen/blobpwrdisplay
var/obj/screen/blobhealthdisplay
var/obj/screen/r_hand_hud_object
var/obj/screen/l_hand_hud_object
var/obj/screen/action_intent
var/obj/screen/move_intent
var/list/adding
var/list/other
var/list/obj/screen/hotkeybuttons
var/list/obj/screen/item_action/item_action_list = list() //Used for the item action ui buttons.
datum/hud/New(mob/owner)
mymob = owner
instantiate()
..()
/datum/hud/proc/hidden_inventory_update()
if(!mymob) return
if(ishuman(mymob))
var/mob/living/carbon/human/H = mymob
if(inventory_shown && hud_shown)
if(H.shoes) H.shoes.screen_loc = ui_shoes
if(H.gloves) H.gloves.screen_loc = ui_gloves
if(H.l_ear) H.l_ear.screen_loc = ui_l_ear
if(H.r_ear) H.r_ear.screen_loc = ui_r_ear
if(H.glasses) H.glasses.screen_loc = ui_glasses
if(H.w_uniform) H.w_uniform.screen_loc = ui_iclothing
if(H.wear_suit) H.wear_suit.screen_loc = ui_oclothing
if(H.wear_mask) H.wear_mask.screen_loc = ui_mask
if(H.head) H.head.screen_loc = ui_head
else
if(H.shoes) H.shoes.screen_loc = null
if(H.gloves) H.gloves.screen_loc = null
if(H.l_ear) H.l_ear.screen_loc = null
if(H.r_ear) H.r_ear.screen_loc = null
if(H.glasses) H.glasses.screen_loc = null
if(H.w_uniform) H.w_uniform.screen_loc = null
if(H.wear_suit) H.wear_suit.screen_loc = null
if(H.wear_mask) H.wear_mask.screen_loc = null
if(H.head) H.head.screen_loc = null
/datum/hud/proc/persistant_inventory_update()
if(!mymob)
return
if(ishuman(mymob))
var/mob/living/carbon/human/H = mymob
if(hud_shown)
if(H.s_store) H.s_store.screen_loc = ui_sstore1
if(H.wear_id) H.wear_id.screen_loc = ui_id
if(H.belt) H.belt.screen_loc = ui_belt
if(H.back) H.back.screen_loc = ui_back
if(H.l_store) H.l_store.screen_loc = ui_storage1
if(H.r_store) H.r_store.screen_loc = ui_storage2
else
if(H.s_store) H.s_store.screen_loc = null
if(H.wear_id) H.wear_id.screen_loc = null
if(H.belt) H.belt.screen_loc = null
if(H.back) H.back.screen_loc = null
if(H.l_store) H.l_store.screen_loc = null
if(H.r_store) H.r_store.screen_loc = null
/datum/hud/proc/instantiate()
if(!ismob(mymob)) return 0
if(!mymob.client) return 0
var/ui_style = ui_style2icon(mymob.client.prefs.UI_style)
if(ishuman(mymob))
human_hud(ui_style) // Pass the player the UI style chosen in preferences
else if(ismonkey(mymob))
monkey_hud(ui_style)
else if(isbrain(mymob))
brain_hud(ui_style)
else if(islarva(mymob))
larva_hud()
else if(isalien(mymob))
alien_hud()
else if(isAI(mymob))
ai_hud()
else if(isrobot(mymob))
robot_hud()
else if(isobserver(mymob))
ghost_hud()
//Triggered when F12 is pressed (Unless someone changed something in the DMF)
/mob/verb/button_pressed_F12()
set name = "F12"
set hidden = 1
if(hud_used)
if(ishuman(src))
if(!src.client) return
if(hud_used.hud_shown)
hud_used.hud_shown = 0
if(src.hud_used.adding)
src.client.screen -= src.hud_used.adding
if(src.hud_used.other)
src.client.screen -= src.hud_used.other
if(src.hud_used.hotkeybuttons)
src.client.screen -= src.hud_used.hotkeybuttons
if(src.hud_used.item_action_list)
src.client.screen -= src.hud_used.item_action_list
//Due to some poor coding some things need special treatment:
//These ones are a part of 'adding', 'other' or 'hotkeybuttons' but we want them to stay
src.client.screen += src.hud_used.l_hand_hud_object //we want the hands to be visible
src.client.screen += src.hud_used.r_hand_hud_object //we want the hands to be visible
src.client.screen += src.hud_used.action_intent //we want the intent swticher visible
src.hud_used.action_intent.screen_loc = ui_acti_alt //move this to the alternative position, where zone_select usually is.
//These ones are not a part of 'adding', 'other' or 'hotkeybuttons' but we want them gone.
src.client.screen -= src.zone_sel //zone_sel is a mob variable for some reason.
else
hud_used.hud_shown = 1
if(src.hud_used.adding)
src.client.screen += src.hud_used.adding
if(src.hud_used.other && src.hud_used.inventory_shown)
src.client.screen += src.hud_used.other
if(src.hud_used.hotkeybuttons && !src.hud_used.hotkey_ui_hidden)
src.client.screen += src.hud_used.hotkeybuttons
src.hud_used.action_intent.screen_loc = ui_acti //Restore intent selection to the original position
src.client.screen += src.zone_sel //This one is a special snowflake
hud_used.hidden_inventory_update()
hud_used.persistant_inventory_update()
update_action_buttons()
else
usr << "\red Inventory hiding is currently only supported for human mobs, sorry."
else
usr << "\red This mob type does not use a HUD."

View File

@@ -1,249 +1,248 @@
/datum/hud/proc/monkey_hud(var/ui_style='icons/mob/screen1_old.dmi')
src.adding = list()
src.other = list()
var/obj/screen/using
var/obj/screen/inventory/inv_box
using = new /obj/screen()
using.name = "act_intent"
using.dir = SOUTHWEST
using.icon = ui_style
using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent)
using.screen_loc = ui_acti
using.layer = 20
src.adding += using
action_intent = using
//intent small hud objects
var/icon/ico
ico = new(ui_style, "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
ico.DrawBox(rgb(255,255,255,1),1,ico.Height()/2,ico.Width()/2,ico.Height())
using = new /obj/screen( src )
using.name = "help"
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
help_intent = using
ico = new(ui_style, "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,ico.Height()/2,ico.Width(),ico.Height())
using = new /obj/screen( src )
using.name = "disarm"
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
disarm_intent = using
ico = new(ui_style, "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,1,ico.Width(),ico.Height()/2)
using = new /obj/screen( src )
using.name = "grab"
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
grab_intent = using
ico = new(ui_style, "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
ico.DrawBox(rgb(255,255,255,1),1,1,ico.Width()/2,ico.Height()/2)
using = new /obj/screen( src )
using.name = "harm"
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
hurt_intent = using
//end intent small hud objects
using = new /obj/screen()
using.name = "mov_intent"
using.dir = SOUTHWEST
using.icon = ui_style
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
using.screen_loc = ui_movi
using.layer = 20
src.adding += using
move_intent = using
using = new /obj/screen()
using.name = "drop"
using.icon = ui_style
using.icon_state = "act_drop"
using.screen_loc = ui_drop_throw
using.layer = 19
src.adding += using
inv_box = new /obj/screen/inventory()
inv_box.name = "r_hand"
inv_box.dir = WEST
inv_box.icon = ui_style
inv_box.icon_state = "hand_inactive"
if(mymob && !mymob.hand) //This being 0 or null means the right hand is in use
inv_box.icon_state = "hand_active"
inv_box.screen_loc = ui_rhand
inv_box.slot_id = slot_r_hand
inv_box.layer = 19
src.r_hand_hud_object = inv_box
src.adding += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "l_hand"
inv_box.dir = EAST
inv_box.icon = ui_style
inv_box.icon_state = "hand_inactive"
if(mymob && mymob.hand) //This being 1 means the left hand is in use
inv_box.icon_state = "hand_active"
inv_box.screen_loc = ui_lhand
inv_box.slot_id = slot_l_hand
inv_box.layer = 19
src.l_hand_hud_object = inv_box
src.adding += inv_box
using = new /obj/screen()
using.name = "hand"
using.dir = SOUTH
using.icon = ui_style
using.icon_state = "hand1"
using.screen_loc = ui_swaphand1
using.layer = 19
src.adding += using
using = new /obj/screen()
using.name = "hand"
using.dir = SOUTH
using.icon = ui_style
using.icon_state = "hand2"
using.screen_loc = ui_swaphand2
using.layer = 19
src.adding += using
inv_box = new /obj/screen/inventory()
inv_box.name = "mask"
inv_box.dir = NORTH
inv_box.icon = ui_style
inv_box.icon_state = "equip"
inv_box.screen_loc = ui_monkey_mask
inv_box.slot_id = slot_wear_mask
inv_box.layer = 19
src.adding += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "back"
inv_box.dir = NORTHEAST
inv_box.icon = ui_style
inv_box.icon_state = "equip"
inv_box.screen_loc = ui_back
inv_box.slot_id = slot_back
inv_box.layer = 19
src.adding += inv_box
mymob.throw_icon = new /obj/screen()
mymob.throw_icon.icon = ui_style
mymob.throw_icon.icon_state = "act_throw_off"
mymob.throw_icon.name = "throw"
mymob.throw_icon.screen_loc = ui_drop_throw
mymob.oxygen = new /obj/screen()
mymob.oxygen.icon = ui_style
mymob.oxygen.icon_state = "oxy0"
mymob.oxygen.name = "oxygen"
mymob.oxygen.screen_loc = ui_oxygen
mymob.pressure = new /obj/screen()
mymob.pressure.icon = ui_style
mymob.pressure.icon_state = "pressure0"
mymob.pressure.name = "pressure"
mymob.pressure.screen_loc = ui_pressure
mymob.toxin = new /obj/screen()
mymob.toxin.icon = ui_style
mymob.toxin.icon_state = "tox0"
mymob.toxin.name = "toxin"
mymob.toxin.screen_loc = ui_toxin
mymob.internals = new /obj/screen()
mymob.internals.icon = ui_style
mymob.internals.icon_state = "internal0"
mymob.internals.name = "internal"
mymob.internals.screen_loc = ui_internal
mymob.fire = new /obj/screen()
mymob.fire.icon = ui_style
mymob.fire.icon_state = "fire0"
mymob.fire.name = "fire"
mymob.fire.screen_loc = ui_fire
mymob.bodytemp = new /obj/screen()
mymob.bodytemp.icon = ui_style
mymob.bodytemp.icon_state = "temp1"
mymob.bodytemp.name = "body temperature"
mymob.bodytemp.screen_loc = ui_temp
mymob.healths = new /obj/screen()
mymob.healths.icon = ui_style
mymob.healths.icon_state = "health0"
mymob.healths.name = "health"
mymob.healths.screen_loc = ui_health
mymob.pullin = new /obj/screen()
mymob.pullin.icon = ui_style
mymob.pullin.icon_state = "pull0"
mymob.pullin.name = "pull"
mymob.pullin.screen_loc = ui_pull_resist
mymob.blind = new /obj/screen()
mymob.blind.icon = 'icons/mob/screen1_full.dmi'
mymob.blind.icon_state = "blackimageoverlay"
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1"
mymob.blind.layer = 0
mymob.flash = new /obj/screen()
mymob.flash.icon = ui_style
mymob.flash.icon_state = "blank"
mymob.flash.name = "flash"
mymob.flash.screen_loc = "1,1 to 15,15"
mymob.flash.layer = 17
mymob.zone_sel = new /obj/screen/zone_sel()
mymob.zone_sel.icon = ui_style
mymob.zone_sel.overlays.Cut()
mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")
//Handle the gun settings buttons
mymob.gun_setting_icon = new /obj/screen/gun/mode(null)
if (mymob.client)
if (mymob.client.gun_mode) // If in aim mode, correct the sprite
mymob.gun_setting_icon.dir = 2
for(var/obj/item/weapon/gun/G in mymob) // If targeting someone, display other buttons
if (G.target)
mymob.item_use_icon = new /obj/screen/gun/item(null)
if (mymob.client.target_can_click)
mymob.item_use_icon.dir = 1
src.adding += mymob.item_use_icon
mymob.gun_move_icon = new /obj/screen/gun/move(null)
if (mymob.client.target_can_move)
mymob.gun_move_icon.dir = 1
mymob.gun_run_icon = new /obj/screen/gun/run(null)
if (mymob.client.target_can_run)
mymob.gun_run_icon.dir = 1
src.adding += mymob.gun_run_icon
src.adding += mymob.gun_move_icon
mymob.client.screen = null
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.pressure, mymob.toxin, mymob.bodytemp, mymob.internals, mymob.fire, mymob.healths, mymob.pullin, mymob.blind, mymob.flash, mymob.gun_setting_icon) //, mymob.hands, mymob.rest, mymob.sleep, mymob.mach )
mymob.client.screen += src.adding + src.other
return
/datum/hud/proc/monkey_hud(var/ui_style='icons/mob/screen1_old.dmi')
src.adding = list()
src.other = list()
var/obj/screen/using
var/obj/screen/inventory/inv_box
using = new /obj/screen()
using.name = "act_intent"
using.dir = SOUTHWEST
using.icon = ui_style
using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent)
using.screen_loc = ui_acti
using.layer = 20
src.adding += using
action_intent = using
//intent small hud objects
var/icon/ico
ico = new(ui_style, "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
ico.DrawBox(rgb(255,255,255,1),1,ico.Height()/2,ico.Width()/2,ico.Height())
using = new /obj/screen( src )
using.name = "help"
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
help_intent = using
ico = new(ui_style, "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,ico.Height()/2,ico.Width(),ico.Height())
using = new /obj/screen( src )
using.name = "disarm"
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
disarm_intent = using
ico = new(ui_style, "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,1,ico.Width(),ico.Height()/2)
using = new /obj/screen( src )
using.name = "grab"
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
grab_intent = using
ico = new(ui_style, "black")
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
ico.DrawBox(rgb(255,255,255,1),1,1,ico.Width()/2,ico.Height()/2)
using = new /obj/screen( src )
using.name = "harm"
using.icon = ico
using.screen_loc = ui_acti
using.layer = 21
src.adding += using
hurt_intent = using
//end intent small hud objects
using = new /obj/screen()
using.name = "mov_intent"
using.dir = SOUTHWEST
using.icon = ui_style
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
using.screen_loc = ui_movi
using.layer = 20
src.adding += using
move_intent = using
using = new /obj/screen()
using.name = "drop"
using.icon = ui_style
using.icon_state = "act_drop"
using.screen_loc = ui_drop_throw
using.layer = 19
src.adding += using
inv_box = new /obj/screen/inventory()
inv_box.name = "r_hand"
inv_box.dir = WEST
inv_box.icon = ui_style
inv_box.icon_state = "hand_inactive"
if(mymob && !mymob.hand) //This being 0 or null means the right hand is in use
inv_box.icon_state = "hand_active"
inv_box.screen_loc = ui_rhand
inv_box.slot_id = slot_r_hand
inv_box.layer = 19
src.r_hand_hud_object = inv_box
src.adding += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "l_hand"
inv_box.dir = EAST
inv_box.icon = ui_style
inv_box.icon_state = "hand_inactive"
if(mymob && mymob.hand) //This being 1 means the left hand is in use
inv_box.icon_state = "hand_active"
inv_box.screen_loc = ui_lhand
inv_box.slot_id = slot_l_hand
inv_box.layer = 19
src.l_hand_hud_object = inv_box
src.adding += inv_box
using = new /obj/screen()
using.name = "hand"
using.dir = SOUTH
using.icon = ui_style
using.icon_state = "hand1"
using.screen_loc = ui_swaphand1
using.layer = 19
src.adding += using
using = new /obj/screen()
using.name = "hand"
using.dir = SOUTH
using.icon = ui_style
using.icon_state = "hand2"
using.screen_loc = ui_swaphand2
using.layer = 19
src.adding += using
inv_box = new /obj/screen/inventory()
inv_box.name = "mask"
inv_box.dir = NORTH
inv_box.icon = ui_style
inv_box.icon_state = "equip"
inv_box.screen_loc = ui_monkey_mask
inv_box.slot_id = slot_wear_mask
inv_box.layer = 19
src.adding += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "back"
inv_box.dir = NORTHEAST
inv_box.icon = ui_style
inv_box.icon_state = "equip"
inv_box.screen_loc = ui_back
inv_box.slot_id = slot_back
inv_box.layer = 19
src.adding += inv_box
mymob.throw_icon = new /obj/screen()
mymob.throw_icon.icon = ui_style
mymob.throw_icon.icon_state = "act_throw_off"
mymob.throw_icon.name = "throw"
mymob.throw_icon.screen_loc = ui_drop_throw
mymob.oxygen = new /obj/screen()
mymob.oxygen.icon = ui_style
mymob.oxygen.icon_state = "oxy0"
mymob.oxygen.name = "oxygen"
mymob.oxygen.screen_loc = ui_oxygen
mymob.pressure = new /obj/screen()
mymob.pressure.icon = ui_style
mymob.pressure.icon_state = "pressure0"
mymob.pressure.name = "pressure"
mymob.pressure.screen_loc = ui_pressure
mymob.toxin = new /obj/screen()
mymob.toxin.icon = ui_style
mymob.toxin.icon_state = "tox0"
mymob.toxin.name = "toxin"
mymob.toxin.screen_loc = ui_toxin
mymob.internals = new /obj/screen()
mymob.internals.icon = ui_style
mymob.internals.icon_state = "internal0"
mymob.internals.name = "internal"
mymob.internals.screen_loc = ui_internal
mymob.fire = new /obj/screen()
mymob.fire.icon = ui_style
mymob.fire.icon_state = "fire0"
mymob.fire.name = "fire"
mymob.fire.screen_loc = ui_fire
mymob.bodytemp = new /obj/screen()
mymob.bodytemp.icon = ui_style
mymob.bodytemp.icon_state = "temp1"
mymob.bodytemp.name = "body temperature"
mymob.bodytemp.screen_loc = ui_temp
mymob.healths = new /obj/screen()
mymob.healths.icon = ui_style
mymob.healths.icon_state = "health0"
mymob.healths.name = "health"
mymob.healths.screen_loc = ui_health
mymob.pullin = new /obj/screen()
mymob.pullin.icon = ui_style
mymob.pullin.icon_state = "pull0"
mymob.pullin.name = "pull"
mymob.pullin.screen_loc = ui_pull_resist
mymob.blind = new /obj/screen()
mymob.blind.icon = 'icons/mob/screen1_full.dmi'
mymob.blind.icon_state = "blackimageoverlay"
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1"
mymob.blind.layer = 0
mymob.flash = new /obj/screen()
mymob.flash.icon = ui_style
mymob.flash.icon_state = "blank"
mymob.flash.name = "flash"
mymob.flash.screen_loc = "1,1 to 15,15"
mymob.flash.layer = 17
mymob.zone_sel = new /obj/screen/zone_sel()
mymob.zone_sel.icon = ui_style
mymob.zone_sel.overlays.Cut()
mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")
//Handle the gun settings buttons
mymob.gun_setting_icon = new /obj/screen/gun/mode(null)
if (mymob.client)
if (mymob.client.gun_mode) // If in aim mode, correct the sprite
mymob.gun_setting_icon.dir = 2
for(var/obj/item/weapon/gun/G in mymob) // If targeting someone, display other buttons
if (G.target)
mymob.item_use_icon = new /obj/screen/gun/item(null)
if (mymob.client.target_can_click)
mymob.item_use_icon.dir = 1
src.adding += mymob.item_use_icon
mymob.gun_move_icon = new /obj/screen/gun/move(null)
if (mymob.client.target_can_move)
mymob.gun_move_icon.dir = 1
mymob.gun_run_icon = new /obj/screen/gun/run(null)
if (mymob.client.target_can_run)
mymob.gun_run_icon.dir = 1
src.adding += mymob.gun_run_icon
src.adding += mymob.gun_move_icon
mymob.client.screen = null
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.pressure, mymob.toxin, mymob.bodytemp, mymob.internals, mymob.fire, mymob.healths, mymob.pullin, mymob.blind, mymob.flash, mymob.gun_setting_icon) //, mymob.hands, mymob.rest, mymob.sleep, mymob.mach )
mymob.client.screen += src.adding + src.other
return

View File

@@ -0,0 +1,35 @@
/datum/hud/proc/unplayer_hud()
return
/datum/hud/proc/ghost_hud()
return
/datum/hud/proc/brain_hud(ui_style = 'icons/mob/screen1_Midnight.dmi')
mymob.blind = new /obj/screen()
mymob.blind.icon = 'icons/mob/screen1_full.dmi'
mymob.blind.icon_state = "blackimageoverlay"
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1"
mymob.blind.layer = 0
/datum/hud/proc/ai_hud()
return
/datum/hud/proc/blob_hud(ui_style = 'icons/mob/screen1_Midnight.dmi')
blobpwrdisplay = new /obj/screen()
blobpwrdisplay.name = "blob power"
blobpwrdisplay.icon_state = "block"
blobpwrdisplay.screen_loc = ui_health
blobpwrdisplay.layer = 20
blobhealthdisplay = new /obj/screen()
blobhealthdisplay.name = "blob health"
blobhealthdisplay.icon_state = "block"
blobhealthdisplay.screen_loc = ui_internal
blobhealthdisplay.layer = 20
mymob.client.screen = null
mymob.client.screen += list(blobpwrdisplay, blobhealthdisplay)

View File

@@ -1,171 +1,170 @@
/datum/hud/proc/robot_hud()
src.adding = list()
src.other = list()
var/obj/screen/using
//Radio
using = new /obj/screen()
using.name = "radio"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon_state = "radio"
using.screen_loc = ui_movi
using.layer = 20
src.adding += using
//Module select
using = new /obj/screen()
using.name = "module1"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon_state = "inv1"
using.screen_loc = ui_inv1
using.layer = 20
src.adding += using
mymob:inv1 = using
using = new /obj/screen()
using.name = "module2"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon_state = "inv2"
using.screen_loc = ui_inv2
using.layer = 20
src.adding += using
mymob:inv2 = using
using = new /obj/screen()
using.name = "module3"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon_state = "inv3"
using.screen_loc = ui_inv3
using.layer = 20
src.adding += using
mymob:inv3 = using
//End of module select
//Intent
using = new /obj/screen()
using.name = "act_intent"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent)
using.screen_loc = ui_acti
using.layer = 20
src.adding += using
action_intent = using
//Cell
mymob:cells = new /obj/screen()
mymob:cells.icon = 'icons/mob/screen1_robot.dmi'
mymob:cells.icon_state = "charge-empty"
mymob:cells.name = "cell"
mymob:cells.screen_loc = ui_toxin
//Health
mymob.healths = new /obj/screen()
mymob.healths.icon = 'icons/mob/screen1_robot.dmi'
mymob.healths.icon_state = "health0"
mymob.healths.name = "health"
mymob.healths.screen_loc = ui_borg_health
//Installed Module
mymob.hands = new /obj/screen()
mymob.hands.icon = 'icons/mob/screen1_robot.dmi'
mymob.hands.icon_state = "nomod"
mymob.hands.name = "module"
mymob.hands.screen_loc = ui_borg_module
//Module Panel
using = new /obj/screen()
using.name = "panel"
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon_state = "panel"
using.screen_loc = ui_borg_panel
using.layer = 19
src.adding += using
//Store
mymob.throw_icon = new /obj/screen()
mymob.throw_icon.icon = 'icons/mob/screen1_robot.dmi'
mymob.throw_icon.icon_state = "store"
mymob.throw_icon.name = "store"
mymob.throw_icon.screen_loc = ui_borg_store
//Temp
mymob.bodytemp = new /obj/screen()
mymob.bodytemp.icon_state = "temp0"
mymob.bodytemp.name = "body temperature"
mymob.bodytemp.screen_loc = ui_temp
mymob.oxygen = new /obj/screen()
mymob.oxygen.icon = 'icons/mob/screen1_robot.dmi'
mymob.oxygen.icon_state = "oxy0"
mymob.oxygen.name = "oxygen"
mymob.oxygen.screen_loc = ui_oxygen
mymob.fire = new /obj/screen()
mymob.fire.icon = 'icons/mob/screen1_robot.dmi'
mymob.fire.icon_state = "fire0"
mymob.fire.name = "fire"
mymob.fire.screen_loc = ui_fire
mymob.pullin = new /obj/screen()
mymob.pullin.icon = 'icons/mob/screen1_robot.dmi'
mymob.pullin.icon_state = "pull0"
mymob.pullin.name = "pull"
mymob.pullin.screen_loc = ui_borg_pull
mymob.blind = new /obj/screen()
mymob.blind.icon = 'icons/mob/screen1_full.dmi'
mymob.blind.icon_state = "blackimageoverlay"
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1"
mymob.blind.layer = 0
mymob.flash = new /obj/screen()
mymob.flash.icon = 'icons/mob/screen1_robot.dmi'
mymob.flash.icon_state = "blank"
mymob.flash.name = "flash"
mymob.flash.screen_loc = "1,1 to 15,15"
mymob.flash.layer = 17
mymob.zone_sel = new /obj/screen/zone_sel()
mymob.zone_sel.icon = 'icons/mob/screen1_robot.dmi'
mymob.zone_sel.overlays.Cut()
mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")
//Handle the gun settings buttons
mymob.gun_setting_icon = new /obj/screen/gun/mode(null)
if (mymob.client)
if (mymob.client.gun_mode) // If in aim mode, correct the sprite
mymob.gun_setting_icon.dir = 2
for(var/obj/item/weapon/gun/G in mymob) // If targeting someone, display other buttons
if (G.target)
mymob.item_use_icon = new /obj/screen/gun/item(null)
if (mymob.client.target_can_click)
mymob.item_use_icon.dir = 1
src.adding += mymob.item_use_icon
mymob.gun_move_icon = new /obj/screen/gun/move(null)
if (mymob.client.target_can_move)
mymob.gun_move_icon.dir = 1
mymob.gun_run_icon = new /obj/screen/gun/run(null)
if (mymob.client.target_can_run)
mymob.gun_run_icon.dir = 1
src.adding += mymob.gun_run_icon
src.adding += mymob.gun_move_icon
mymob.client.screen = null
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.fire, mymob.hands, mymob.healths, mymob:cells, mymob.pullin, mymob.blind, mymob.flash, mymob.gun_setting_icon) //, mymob.rest, mymob.sleep, mymob.mach )
mymob.client.screen += src.adding + src.other
return
/datum/hud/proc/robot_hud()
src.adding = list()
src.other = list()
var/obj/screen/using
//Radio
using = new /obj/screen()
using.name = "radio"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon_state = "radio"
using.screen_loc = ui_movi
using.layer = 20
src.adding += using
//Module select
using = new /obj/screen()
using.name = "module1"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon_state = "inv1"
using.screen_loc = ui_inv1
using.layer = 20
src.adding += using
mymob:inv1 = using
using = new /obj/screen()
using.name = "module2"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon_state = "inv2"
using.screen_loc = ui_inv2
using.layer = 20
src.adding += using
mymob:inv2 = using
using = new /obj/screen()
using.name = "module3"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon_state = "inv3"
using.screen_loc = ui_inv3
using.layer = 20
src.adding += using
mymob:inv3 = using
//End of module select
//Intent
using = new /obj/screen()
using.name = "act_intent"
using.dir = SOUTHWEST
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent)
using.screen_loc = ui_acti
using.layer = 20
src.adding += using
action_intent = using
//Cell
mymob:cells = new /obj/screen()
mymob:cells.icon = 'icons/mob/screen1_robot.dmi'
mymob:cells.icon_state = "charge-empty"
mymob:cells.name = "cell"
mymob:cells.screen_loc = ui_toxin
//Health
mymob.healths = new /obj/screen()
mymob.healths.icon = 'icons/mob/screen1_robot.dmi'
mymob.healths.icon_state = "health0"
mymob.healths.name = "health"
mymob.healths.screen_loc = ui_borg_health
//Installed Module
mymob.hands = new /obj/screen()
mymob.hands.icon = 'icons/mob/screen1_robot.dmi'
mymob.hands.icon_state = "nomod"
mymob.hands.name = "module"
mymob.hands.screen_loc = ui_borg_module
//Module Panel
using = new /obj/screen()
using.name = "panel"
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon_state = "panel"
using.screen_loc = ui_borg_panel
using.layer = 19
src.adding += using
//Store
mymob.throw_icon = new /obj/screen()
mymob.throw_icon.icon = 'icons/mob/screen1_robot.dmi'
mymob.throw_icon.icon_state = "store"
mymob.throw_icon.name = "store"
mymob.throw_icon.screen_loc = ui_borg_store
//Temp
mymob.bodytemp = new /obj/screen()
mymob.bodytemp.icon_state = "temp0"
mymob.bodytemp.name = "body temperature"
mymob.bodytemp.screen_loc = ui_temp
mymob.oxygen = new /obj/screen()
mymob.oxygen.icon = 'icons/mob/screen1_robot.dmi'
mymob.oxygen.icon_state = "oxy0"
mymob.oxygen.name = "oxygen"
mymob.oxygen.screen_loc = ui_oxygen
mymob.fire = new /obj/screen()
mymob.fire.icon = 'icons/mob/screen1_robot.dmi'
mymob.fire.icon_state = "fire0"
mymob.fire.name = "fire"
mymob.fire.screen_loc = ui_fire
mymob.pullin = new /obj/screen()
mymob.pullin.icon = 'icons/mob/screen1_robot.dmi'
mymob.pullin.icon_state = "pull0"
mymob.pullin.name = "pull"
mymob.pullin.screen_loc = ui_borg_pull
mymob.blind = new /obj/screen()
mymob.blind.icon = 'icons/mob/screen1_full.dmi'
mymob.blind.icon_state = "blackimageoverlay"
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1"
mymob.blind.layer = 0
mymob.flash = new /obj/screen()
mymob.flash.icon = 'icons/mob/screen1_robot.dmi'
mymob.flash.icon_state = "blank"
mymob.flash.name = "flash"
mymob.flash.screen_loc = "1,1 to 15,15"
mymob.flash.layer = 17
mymob.zone_sel = new /obj/screen/zone_sel()
mymob.zone_sel.icon = 'icons/mob/screen1_robot.dmi'
mymob.zone_sel.overlays.Cut()
mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")
//Handle the gun settings buttons
mymob.gun_setting_icon = new /obj/screen/gun/mode(null)
if (mymob.client)
if (mymob.client.gun_mode) // If in aim mode, correct the sprite
mymob.gun_setting_icon.dir = 2
for(var/obj/item/weapon/gun/G in mymob) // If targeting someone, display other buttons
if (G.target)
mymob.item_use_icon = new /obj/screen/gun/item(null)
if (mymob.client.target_can_click)
mymob.item_use_icon.dir = 1
src.adding += mymob.item_use_icon
mymob.gun_move_icon = new /obj/screen/gun/move(null)
if (mymob.client.target_can_move)
mymob.gun_move_icon.dir = 1
mymob.gun_run_icon = new /obj/screen/gun/run(null)
if (mymob.client.target_can_run)
mymob.gun_run_icon.dir = 1
src.adding += mymob.gun_run_icon
src.adding += mymob.gun_move_icon
mymob.client.screen = null
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.fire, mymob.hands, mymob.healths, mymob:cells, mymob.pullin, mymob.blind, mymob.flash, mymob.gun_setting_icon) //, mymob.rest, mymob.sleep, mymob.mach )
mymob.client.screen += src.adding + src.other
return

View File

@@ -0,0 +1,444 @@
/*
Screen objects
Todo: improve/re-implement
Screen objects are only used for the hud and should not appear anywhere "in-game".
They are used with the client/screen list and the screen_loc var.
For more information, see the byond documentation on the screen_loc and screen vars.
*/
/obj/screen
name = ""
icon = 'icons/mob/screen1.dmi'
layer = 20.0
unacidable = 1
var/obj/master = null //A reference to the object in the slot. Grabs or items, generally.
var/gun_click_time = -100 //I'm lazy.
/obj/screen/text
icon = null
icon_state = null
mouse_opacity = 0
screen_loc = "CENTER-7,CENTER-7"
maptext_height = 480
maptext_width = 480
/obj/screen/inventory
var/slot_id //The indentifier for the slot. It has nothing to do with ID cards.
/obj/screen/close
name = "close"
/obj/screen/close/Click()
if(master)
if(istype(master, /obj/item/weapon/storage))
var/obj/item/weapon/storage/S = master
S.close(usr)
return 1
/obj/screen/item_action
var/obj/item/owner
/obj/screen/item_action/Click()
if(!usr || !owner)
return 1
if(usr.next_move >= world.time)
return
usr.next_move = world.time + 10
if(usr.stat || usr.restrained() || usr.stunned || usr.lying)
return 1
if(!(owner in usr))
return 1
owner.ui_action_click()
return 1
//This is the proc used to update all the action buttons. It just returns for all mob types except humans.
/mob/proc/update_action_buttons()
return
/obj/screen/grab
name = "grab"
/obj/screen/grab/Click()
var/obj/item/weapon/grab/G = master
G.s_click(src)
return 1
/obj/screen/grab/attack_hand()
return
/obj/screen/grab/attackby()
return
/obj/screen/storage
name = "storage"
/obj/screen/storage/Click()
if(world.time <= usr.next_move)
return 1
if(usr.stat || usr.paralysis || usr.stunned || usr.weakened)
return 1
if(master)
var/obj/item/I = usr.get_active_hand()
if(I)
master.attackby(I, usr)
usr.next_move = world.time+2
return 1
/obj/screen/gun
name = "gun"
icon = 'icons/mob/screen1.dmi'
master = null
dir = 2
move
name = "Allow Walking"
icon_state = "no_walk0"
screen_loc = ui_gun2
run
name = "Allow Running"
icon_state = "no_run0"
screen_loc = ui_gun3
item
name = "Allow Item Use"
icon_state = "no_item0"
screen_loc = ui_gun1
mode
name = "Toggle Gun Mode"
icon_state = "gun0"
screen_loc = ui_gun_select
//dir = 1
/obj/screen/zone_sel
name = "damage zone"
icon_state = "zone_sel"
screen_loc = ui_zonesel
var/selecting = "chest"
/obj/screen/zone_sel/Click(location, control,params)
var/list/PL = params2list(params)
var/icon_x = text2num(PL["icon-x"])
var/icon_y = text2num(PL["icon-y"])
var/old_selecting = selecting //We're only going to update_icon() if there's been a change
switch(icon_y)
if(1 to 3) //Feet
switch(icon_x)
if(10 to 15)
selecting = "r_foot"
if(17 to 22)
selecting = "l_foot"
else
return 1
if(4 to 9) //Legs
switch(icon_x)
if(10 to 15)
selecting = "r_leg"
if(17 to 22)
selecting = "l_leg"
else
return 1
if(10 to 13) //Hands and groin
switch(icon_x)
if(8 to 11)
selecting = "r_hand"
if(12 to 20)
selecting = "groin"
if(21 to 24)
selecting = "l_hand"
else
return 1
if(14 to 22) //Chest and arms to shoulders
switch(icon_x)
if(8 to 11)
selecting = "r_arm"
if(12 to 20)
selecting = "chest"
if(21 to 24)
selecting = "l_arm"
else
return 1
if(23 to 30) //Head, but we need to check for eye or mouth
if(icon_x in 12 to 20)
selecting = "head"
switch(icon_y)
if(23 to 24)
if(icon_x in 15 to 17)
selecting = "mouth"
if(26) //Eyeline, eyes are on 15 and 17
if(icon_x in 14 to 18)
selecting = "eyes"
if(25 to 27)
if(icon_x in 15 to 17)
selecting = "eyes"
if(old_selecting != selecting)
update_icon()
return 1
/obj/screen/zone_sel/update_icon()
overlays.Cut()
overlays += image('icons/mob/zone_sel.dmi', "[selecting]")
/obj/screen/Click(location, control, params)
if(!usr) return 1
switch(name)
if("toggle")
if(usr.hud_used.inventory_shown)
usr.hud_used.inventory_shown = 0
usr.client.screen -= usr.hud_used.other
else
usr.hud_used.inventory_shown = 1
usr.client.screen += usr.hud_used.other
usr.hud_used.hidden_inventory_update()
if("equip")
if(ishuman(usr))
var/mob/living/carbon/human/H = usr
H.quick_equip()
if("resist")
if(isliving(usr))
var/mob/living/L = usr
L.resist()
if("mov_intent")
if(iscarbon(usr))
var/mob/living/carbon/C = usr
if(C.legcuffed)
C << "<span class='notice'>You are legcuffed! You cannot run until you get [C.legcuffed] removed!</span>"
C.m_intent = "walk" //Just incase
C.hud_used.move_intent.icon_state = "walking"
return 1
switch(usr.m_intent)
if("run")
usr.m_intent = "walk"
usr.hud_used.move_intent.icon_state = "walking"
if("walk")
usr.m_intent = "run"
usr.hud_used.move_intent.icon_state = "running"
if(istype(usr,/mob/living/carbon/alien/humanoid))
usr.update_icons()
if("m_intent")
if(!usr.m_int)
switch(usr.m_intent)
if("run")
usr.m_int = "13,14"
if("walk")
usr.m_int = "14,14"
if("face")
usr.m_int = "15,14"
else
usr.m_int = null
if("walk")
usr.m_intent = "walk"
usr.m_int = "14,14"
if("face")
usr.m_intent = "face"
usr.m_int = "15,14"
if("run")
usr.m_intent = "run"
usr.m_int = "13,14"
if("Reset Machine")
usr.unset_machine()
if("internal")
if(iscarbon(usr))
var/mob/living/carbon/C = usr
if(!C.stat && !C.stunned && !C.paralysis && !C.restrained())
if(C.internal)
C.internal = null
C << "<span class='notice'>No longer running on internals.</span>"
if(C.internals)
C.internals.icon_state = "internal0"
else
if(!istype(C.wear_mask, /obj/item/clothing/mask))
C << "<span class='notice'>You are not wearing a mask.</span>"
return 1
else
if(istype(C.l_hand, /obj/item/weapon/tank))
C << "<span class='notice'>You are now running on internals from the [C.l_hand] on your left hand.</span>"
C.internal = C.l_hand
else if(istype(C.r_hand, /obj/item/weapon/tank))
C << "<span class='notice'>You are now running on internals from the [C.r_hand] on your right hand.</span>"
C.internal = C.r_hand
else if(ishuman(C))
var/mob/living/carbon/human/H = C
if(istype(H.s_store, /obj/item/weapon/tank))
H << "<span class='notice'>You are now running on internals from the [H.s_store] on your [H.wear_suit].</span>"
H.internal = H.s_store
else if(istype(H.belt, /obj/item/weapon/tank))
H << "<span class='notice'>You are now running on internals from the [H.belt] on your belt.</span>"
H.internal = H.belt
else if(istype(H.l_store, /obj/item/weapon/tank))
H << "<span class='notice'>You are now running on internals from the [H.l_store] in your left pocket.</span>"
H.internal = H.l_store
else if(istype(H.r_store, /obj/item/weapon/tank))
H << "<span class='notice'>You are now running on internals from the [H.r_store] in your right pocket.</span>"
H.internal = H.r_store
//Seperate so CO2 jetpacks are a little less cumbersome.
if(!C.internal && istype(C.back, /obj/item/weapon/tank))
C << "<span class='notice'>You are now running on internals from the [C.back] on your back.</span>"
C.internal = C.back
if(C.internal)
if(C.internals)
C.internals.icon_state = "internal1"
else
C << "<span class='notice'>You don't have an oxygen tank.</span>"
if("act_intent")
usr.a_intent_change("right")
if("help")
usr.a_intent = "help"
usr.hud_used.action_intent.icon_state = "intent_help"
if("harm")
usr.a_intent = "hurt"
usr.hud_used.action_intent.icon_state = "intent_hurt"
if("grab")
usr.a_intent = "grab"
usr.hud_used.action_intent.icon_state = "intent_grab"
if("disarm")
usr.a_intent = "disarm"
usr.hud_used.action_intent.icon_state = "intent_disarm"
if("pull")
usr.stop_pulling()
if("throw")
if(!usr.stat && isturf(usr.loc) && !usr.restrained())
usr:toggle_throw_mode()
if("drop")
usr.drop_item_v()
if("module")
if(issilicon(usr))
if(usr:module)
return 1
usr:pick_module()
if("radio")
if(issilicon(usr))
usr:radio_menu()
if("panel")
if(issilicon(usr))
usr:installed_modules()
if("store")
if(issilicon(usr))
usr:uneq_active()
if("module1")
if(istype(usr, /mob/living/silicon/robot))
usr:toggle_module(1)
if("module2")
if(istype(usr, /mob/living/silicon/robot))
usr:toggle_module(2)
if("module3")
if(istype(usr, /mob/living/silicon/robot))
usr:toggle_module(3)
if("Allow Walking")
if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
return
if(!istype(usr.equipped(),/obj/item/weapon/gun))
usr << "You need your gun in your active hand to do that!"
return
usr.client.AllowTargetMove()
gun_click_time = world.time
if("Disallow Walking")
if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
return
if(!istype(usr.equipped(),/obj/item/weapon/gun))
usr << "You need your gun in your active hand to do that!"
return
usr.client.AllowTargetMove()
gun_click_time = world.time
if("Allow Running")
if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
return
if(!istype(usr.equipped(),/obj/item/weapon/gun))
usr << "You need your gun in your active hand to do that!"
return
usr.client.AllowTargetRun()
gun_click_time = world.time
if("Disallow Running")
if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
return
if(!istype(usr.equipped(),/obj/item/weapon/gun))
usr << "You need your gun in your active hand to do that!"
return
usr.client.AllowTargetRun()
gun_click_time = world.time
if("Allow Item Use")
if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
return
if(!istype(usr.equipped(),/obj/item/weapon/gun))
usr << "You need your gun in your active hand to do that!"
return
usr.client.AllowTargetClick()
gun_click_time = world.time
if("Disallow Item Use")
if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes.
return
if(!istype(usr.equipped(),/obj/item/weapon/gun))
usr << "You need your gun in your active hand to do that!"
return
usr.client.AllowTargetClick()
gun_click_time = world.time
if("Toggle Gun Mode")
usr.client.ToggleGunMode()
else
return 0
return 1
/obj/screen/inventory/Click()
// At this point in client Click() code we have passed the 1/10 sec check and little else
// We don't even know if it's a middle click
if(world.time <= usr.next_move)
return 1
if(usr.stat || usr.paralysis || usr.stunned || usr.weakened)
return 1
switch(name)
if("r_hand")
if(iscarbon(usr))
var/mob/living/carbon/C = usr
C.activate_hand("r")
usr.next_move = world.time+2
if("l_hand")
if(iscarbon(usr))
var/mob/living/carbon/C = usr
C.activate_hand("l")
usr.next_move = world.time+2
if("swap")
usr:swap_hand()
if("hand")
usr:swap_hand()
else
if(usr.attack_ui(slot_id))
usr.update_inv_l_hand(0)
usr.update_inv_r_hand(0)
usr.next_move = world.time+6
return 1

View File

@@ -0,0 +1,163 @@
// Called when the item is in the active hand, and clicked; alternately, there is an 'activate held object' verb or you can hit pagedown.
/obj/item/proc/attack_self(mob/user)
return
// No comment
/atom/proc/attackby(obj/item/W, mob/user)
return
/atom/movable/attackby(obj/item/W, mob/user)
if(!(W.flags&NOBLUDGEON))
visible_message("<span class='danger'>[src] has been hit by [user] with [W].</span>")
/mob/living/attackby(obj/item/I, mob/user)
if(istype(I) && ismob(user))
I.attack(src, user)
// Proximity_flag is 1 if this afterattack was called on something adjacent, in your square, or on your person.
// Click parameters is the params string from byond Click() code, see that documentation.
/obj/item/proc/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
return
/obj/item/proc/attack(mob/living/M as mob, mob/living/user as mob, def_zone)
if (!istype(M)) // not sure if this is the right thing...
return
var/messagesource = M
if (can_operate(M)) //Checks if mob is lying down on table for surgery
if (do_surgery(M,user,src))
return
if (istype(M,/mob/living/carbon/brain))
messagesource = M:container
if (hitsound)
playsound(loc, hitsound, 50, 1, -1)
/////////////////////////
user.lastattacked = M
M.lastattacker = user
user.attack_log += "\[[time_stamp()]\]<font color='red'> Attacked [M.name] ([M.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])</font>"
M.attack_log += "\[[time_stamp()]\]<font color='orange'> Attacked by [user.name] ([user.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])</font>"
log_attack("<font color='red'>[user.name] ([user.ckey]) attacked [M.name] ([M.ckey]) with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])</font>" )
//spawn(1800) // this wont work right
// M.lastattacker = null
/////////////////////////
var/power = force
if(HULK in user.mutations)
power *= 2
if(!istype(M, /mob/living/carbon/human))
if(istype(M, /mob/living/carbon/slime))
var/mob/living/carbon/slime/slime = M
if(prob(25))
user << "\red [src] passes right through [M]!"
return
if(power > 0)
slime.attacked += 10
if(slime.Discipline && prob(50)) // wow, buddy, why am I getting attacked??
slime.Discipline = 0
if(power >= 3)
if(istype(slime, /mob/living/carbon/slime/adult))
if(prob(5 + round(power/2)))
if(slime.Victim)
if(prob(80) && !slime.client)
slime.Discipline++
slime.Victim = null
slime.anchored = 0
spawn()
if(slime)
slime.SStun = 1
sleep(rand(5,20))
if(slime)
slime.SStun = 0
spawn(0)
if(slime)
slime.canmove = 0
step_away(slime, user)
if(prob(25 + power))
sleep(2)
if(slime && user)
step_away(slime, user)
slime.canmove = 1
else
if(prob(10 + power*2))
if(slime)
if(slime.Victim)
if(prob(80) && !slime.client)
slime.Discipline++
if(slime.Discipline == 1)
slime.attacked = 0
spawn()
if(slime)
slime.SStun = 1
sleep(rand(5,20))
if(slime)
slime.SStun = 0
slime.Victim = null
slime.anchored = 0
spawn(0)
if(slime && user)
step_away(slime, user)
slime.canmove = 0
if(prob(25 + power*4))
sleep(2)
if(slime && user)
step_away(slime, user)
slime.canmove = 1
var/showname = "."
if(user)
showname = " by [user]."
if(!(user in viewers(M, null)))
showname = "."
for(var/mob/O in viewers(messagesource, null))
if(attack_verb.len)
O.show_message("\red <B>[M] has been [pick(attack_verb)] with [src][showname] </B>", 1)
else
O.show_message("\red <B>[M] has been attacked with [src][showname] </B>", 1)
if(!showname && user)
if(user.client)
user << "\red <B>You attack [M] with [src]. </B>"
if(istype(M, /mob/living/carbon/human))
M:attacked_by(src, user, def_zone)
else
switch(damtype)
if("brute")
if(istype(src, /mob/living/carbon/slime))
M.adjustBrainLoss(power)
else
M.take_organ_damage(power)
if (prob(33)) // Added blood for whacking non-humans too
var/turf/location = M.loc
if (istype(location, /turf/simulated))
location:add_blood_floor(M)
if("fire")
if (!(COLD_RESISTANCE in M.mutations))
M.take_organ_damage(0, power)
M << "Aargh it burns!"
M.updatehealth()
add_fingerprint(user)
return 1

104
code/_onclick/observer.dm Normal file
View File

@@ -0,0 +1,104 @@
/client/var/inquisitive_ghost = 1
/mob/dead/observer/verb/toggle_inquisition() // warning: unexpected inquisition
set name = "Toggle Inquisitiveness"
set desc = "Sets whether your ghost examines everything on click by default"
set category = "Ghost"
if(!client) return
client.inquisitive_ghost = !client.inquisitive_ghost
if(client.inquisitive_ghost)
src << "\blue You will now examine everything you click on."
else
src << "\blue You will no longer examine things you click on."
/mob/dead/observer/DblClickOn(var/atom/A, var/params)
if(client.buildmode)
build_click(src, client.buildmode, params, A)
return
if(can_reenter_corpse && mind && mind.current)
if(A == mind.current || (mind.current in A)) // double click your corpse or whatever holds it
reenter_corpse() // (cloning scanner, body bag, closet, mech, etc)
return // seems legit.
// Things you might plausibly want to follow
if((ismob(A) && A != src) || istype(A,/obj/machinery/bot) || istype(A,/obj/machinery/singularity))
ManualFollow(A)
// Otherwise jump
else
loc = get_turf(A)
/mob/dead/observer/ClickOn(var/atom/A, var/params)
if(client.buildmode)
build_click(src, client.buildmode, params, A)
return
if(world.time <= next_move) return
next_move = world.time + 8
// You are responsible for checking config.ghost_interaction when you override this function
// Not all of them require checking, see below
A.attack_ghost(src)
// This is the ghost's follow verb with an argument
/mob/dead/observer/proc/ManualFollow(var/atom/target)
following = target
if(target)
src << "\blue Now following [target]"
spawn(0)
var/turf/pos = get_turf(src)
while(loc == pos && target && following == target)
var/turf/T = get_turf(target)
if(!T)
break
if(following != target)
break
if(!client)
break
loc = T
pos = loc
sleep(15)
following = null
// Oh by the way this didn't work with old click code which is why clicking shit didn't spam you
/atom/proc/attack_ghost(mob/dead/observer/user as mob)
if(user.client && user.client.inquisitive_ghost)
examine()
return
// ---------------------------------------
// And here are some good things for free:
// Now you can click through portals, wormholes, gateways, and teleporters while observing. -Sayu
/obj/machinery/teleport/hub/attack_ghost(mob/user as mob)
var/atom/l = loc
var/obj/machinery/computer/teleporter/com = locate(/obj/machinery/computer/teleporter, locate(l.x - 2, l.y, l.z))
if(com.locked)
user.loc = get_turf(com.locked)
/obj/effect/portal/attack_ghost(mob/user as mob)
if(target)
user.loc = get_turf(target)
/obj/machinery/gateway/centerstation/attack_ghost(mob/user as mob)
if(awaygate)
user.loc = awaygate.loc
else
user << "[src] has no destination."
/obj/machinery/gateway/centeraway/attack_ghost(mob/user as mob)
if(stationgate)
user.loc = stationgate.loc
else
user << "[src] has no destination."
// -------------------------------------------
// This was supposed to be used by adminghosts
// I think it is a *terrible* idea
// but I'm leaving it here anyway
// commented out, of course.
/*
/atom/proc/attack_admin(mob/user as mob)
if(!user || !user.client || !user.client.holder)
return
attack_hand(user)
*/

376
code/_onclick/oldcode.dm Normal file
View File

@@ -0,0 +1,376 @@
/atom/DblClick(location, control, params) //TODO: DEFERRED: REWRITE
if(!usr) return
// ------- TIME SINCE LAST CLICK -------
if (world.time <= usr:lastDblClick+1)
return
else
usr:lastDblClick = world.time
//Putting it here for now. It diverts stuff to the mech clicking procs. Putting it here stops us drilling items in our inventory Carn
if(istype(usr.loc,/obj/mecha))
if(usr.client && (src in usr.client.screen))
return
var/obj/mecha/Mech = usr.loc
Mech.click_action(src,usr)
return
// ------- DIR CHANGING WHEN CLICKING ------
if( iscarbon(usr) && !usr.buckled )
if( src.x && src.y && usr.x && usr.y )
var/dx = src.x - usr.x
var/dy = src.y - usr.y
if(dy || dx)
if(abs(dx) < abs(dy))
if(dy > 0) usr.dir = NORTH
else usr.dir = SOUTH
else
if(dx > 0) usr.dir = EAST
else usr.dir = WEST
else
if(pixel_y > 16) usr.dir = NORTH
else if(pixel_y < -16) usr.dir = SOUTH
else if(pixel_x > 16) usr.dir = EAST
else if(pixel_x < -16) usr.dir = WEST
// ------- AI -------
else if (istype(usr, /mob/living/silicon/ai))
var/mob/living/silicon/ai/ai = usr
if (ai.control_disabled)
return
// ------- CYBORG -------
else if (istype(usr, /mob/living/silicon/robot))
var/mob/living/silicon/robot/bot = usr
if (bot.lockcharge) return
..()
// ------- SHIFT-CLICK -------
if(params)
var/parameters = params2list(params)
if(parameters["shift"]){
if(!isAI(usr))
ShiftClick(usr)
else
AIShiftClick(usr)
return
}
// ------- ALT-CLICK -------
if(parameters["alt"]){
if(!isAI(usr))
AltClick(usr)
else
AIAltClick(usr)
return
}
// ------- CTRL-CLICK -------
if(parameters["ctrl"]){
if(!isAI(usr))
CtrlClick(usr)
else
AICtrlClick(usr)
return
}
// ------- MIDDLE-CLICK -------
if(parameters["middle"]){
if(!isAI(usr))
MiddleClick(usr)
return
}
// ------- THROW -------
if(usr.in_throw_mode)
return usr:throw_item(src)
// ------- ITEM IN HAND DEFINED -------
var/obj/item/W = usr.get_active_hand()
/* Now handled by get_active_hand()
// ------- ROBOT -------
if(istype(usr, /mob/living/silicon/robot))
if(!isnull(usr:module_active))
W = usr:module_active
else
W = null
*/
// ------- ATTACK SELF -------
if (W == src && usr.stat == 0)
W.attack_self(usr)
if(usr.hand)
usr.update_inv_l_hand(0) //update in-hand overlays
else
usr.update_inv_r_hand(0)
return
// ------- PARALYSIS, STUN, WEAKENED, DEAD, (And not AI) -------
if (((usr.paralysis || usr.stunned || usr.weakened) && !istype(usr, /mob/living/silicon/ai)) || usr.stat != 0)
return
// ------- CLICKING STUFF IN CONTAINERS -------
if ((!( src in usr.contents ) && (((!( isturf(src) ) && (!( isturf(src.loc) ) && (src.loc && !( isturf(src.loc.loc) )))) || !( isturf(usr.loc) )) && (src.loc != usr.loc && (!( istype(src, /obj/screen) ) && !( usr.contents.Find(src.loc) ))))))
if (istype(usr, /mob/living/silicon/ai))
var/mob/living/silicon/ai/ai = usr
if (ai.control_disabled || ai.malfhacking)
return
else
return
// ------- 1 TILE AWAY -------
var/t5
// ------- AI CAN CLICK ANYTHING -------
if(istype(usr, /mob/living/silicon/ai))
t5 = 1
// ------- CYBORG CAN CLICK ANYTHING WHEN NOT HOLDING STUFF -------
else if(istype(usr, /mob/living/silicon/robot) && !W)
t5 = 1
else
t5 = in_range(src, usr) || src.loc == usr
// world << "according to dblclick(), t5 is [t5]"
// ------- ACTUALLY DETERMINING STUFF -------
if (((t5 || (W && (W.flags & USEDELAY))) && !( istype(src, /obj/screen) )))
// ------- ( CAN USE ITEM OR HAS 1 SECOND USE DELAY ) AND NOT CLICKING ON SCREEN -------
if (usr.next_move < world.time)
usr.prev_move = usr.next_move
usr.next_move = world.time + 10
else
// ------- ALREADY USED ONE ITEM WITH USE DELAY IN THE PREVIOUS SECOND -------
return
// ------- DELAY CHECK PASSED -------
if ((src.loc && (get_dist(src, usr) < 2 || src.loc == usr.loc)))
// ------- CLICKED OBJECT EXISTS IN GAME WORLD, DISTANCE FROM PERSON TO OBJECT IS 1 SQUARE OR THEY'RE ON THE SAME SQUARE -------
var/direct = get_dir(usr, src)
var/obj/item/weapon/dummy/D = new /obj/item/weapon/dummy( usr.loc )
var/ok = 0
if ( (direct - 1) & direct)
// ------- CLICKED OBJECT IS LOCATED IN A DIAGONAL POSITION FROM THE PERSON -------
var/turf/Step_1
var/turf/Step_2
switch(direct)
if(5.0)
Step_1 = get_step(usr, NORTH)
Step_2 = get_step(usr, EAST)
if(6.0)
Step_1 = get_step(usr, SOUTH)
Step_2 = get_step(usr, EAST)
if(9.0)
Step_1 = get_step(usr, NORTH)
Step_2 = get_step(usr, WEST)
if(10.0)
Step_1 = get_step(usr, SOUTH)
Step_2 = get_step(usr, WEST)
else
if(Step_1 && Step_2)
// ------- BOTH CARDINAL DIRECTIONS OF THE DIAGONAL EXIST IN THE GAME WORLD -------
var/check_1 = 0
var/check_2 = 0
if(step_to(D, Step_1))
check_1 = 1
for(var/obj/border_obstacle in Step_1)
if(border_obstacle.flags & ON_BORDER)
if(!border_obstacle.CheckExit(D, src))
check_1 = 0
// ------- YOU TRIED TO CLICK ON AN ITEM THROUGH A WINDOW (OR SIMILAR THING THAT LIMITS ON BORDERS) ON ONE OF THE DIRECITON TILES -------
for(var/obj/border_obstacle in get_turf(src))
if((border_obstacle.flags & ON_BORDER) && (src != border_obstacle))
if(!border_obstacle.CanPass(D, D.loc, 1, 0))
// ------- YOU TRIED TO CLICK ON AN ITEM THROUGH A WINDOW (OR SIMILAR THING THAT LIMITS ON BORDERS) ON THE TILE YOU'RE ON -------
check_1 = 0
D.loc = usr.loc
if(step_to(D, Step_2))
check_2 = 1
for(var/obj/border_obstacle in Step_2)
if(border_obstacle.flags & ON_BORDER)
if(!border_obstacle.CheckExit(D, src))
check_2 = 0
for(var/obj/border_obstacle in get_turf(src))
if((border_obstacle.flags & ON_BORDER) && (src != border_obstacle))
if(!border_obstacle.CanPass(D, D.loc, 1, 0))
check_2 = 0
if(check_1 || check_2)
ok = 1
// ------- YOU CAN REACH THE ITEM THROUGH AT LEAST ONE OF THE TWO DIRECTIONS. GOOD. -------
/*
More info:
If you're trying to click an item in the north-east of your mob, the above section of code will first check if tehre's a tile to the north or you and to the east of you
These two tiles are Step_1 and Step_2. After this, a new dummy object is created on your location. It then tries to move to Step_1, If it succeeds, objects on the turf you're on and
the turf that Step_1 is are checked for items which have the ON_BORDER flag set. These are itmes which limit you on only one tile border. Windows, for the most part.
CheckExit() and CanPass() are use to determine this. The dummy object is then moved back to your location and it tries to move to Step_2. Same checks are performed here.
If at least one of the two checks succeeds, it means you can reach the item and ok is set to 1.
*/
else
// ------- OBJECT IS ON A CARDINAL TILE (NORTH, SOUTH, EAST OR WEST OR THE TILE YOU'RE ON) -------
if(loc == usr.loc)
ok = 1
// ------- OBJECT IS ON THE SAME TILE AS YOU -------
else
ok = 1
//Now, check objects to block exit that are on the border
for(var/obj/border_obstacle in usr.loc)
if(border_obstacle.flags & ON_BORDER)
if(!border_obstacle.CheckExit(D, src))
ok = 0
//Next, check objects to block entry that are on the border
for(var/obj/border_obstacle in get_turf(src))
if((border_obstacle.flags & ON_BORDER) && (src != border_obstacle))
if(!border_obstacle.CanPass(D, D.loc, 1, 0))
ok = 0
/*
See the previous More info, for... more info...
*/
//del(D)
// Garbage Collect Dummy
D.loc = null
D = null
// ------- DUMMY OBJECT'S SERVED IT'S PURPOSE, IT'S REWARDED WITH A SWIFT DELETE -------
if (!( ok ))
// ------- TESTS ABOVE DETERMINED YOU CANNOT REACH THE TILE -------
return 0
if (!( usr.restrained() || (usr.lying && usr.buckled!=src) ))
// ------- YOU ARE NOT REASTRAINED -------
if (W)
// ------- YOU HAVE AN ITEM IN YOUR HAND - HANDLE ATTACKBY AND AFTERATTACK -------
var/ignoreAA = 0 //Ignore afterattack(). Surgery uses this.
if (t5)
ignoreAA = src.attackby(W, usr)
if (W && !ignoreAA)
W.afterattack(src, usr, (t5 ? 1 : 0), params)
else
// ------- YOU DO NOT HAVE AN ITEM IN YOUR HAND -------
if (istype(usr, /mob/living/carbon/human))
// ------- YOU ARE HUMAN -------
src.attack_hand(usr, usr.hand)
else
// ------- YOU ARE NOT HUMAN. WHAT ARE YOU - DETERMINED HERE AND PROPER ATTACK_MOBTYPE CALLED -------
if (istype(usr, /mob/living/carbon/monkey))
src.attack_paw(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/alien/humanoid))
if(usr.m_intent == "walk" && istype(usr, /mob/living/carbon/alien/humanoid/hunter))
usr.m_intent = "run"
usr.hud_used.move_intent.icon_state = "running"
usr.update_icons()
src.attack_alien(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/alien/larva))
src.attack_larva(usr)
else if (istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot))
src.attack_ai(usr, usr.hand)
else if(istype(usr, /mob/living/carbon/slime))
src.attack_slime(usr)
else if(istype(usr, /mob/living/simple_animal))
src.attack_animal(usr)
else
// ------- YOU ARE RESTRAINED. DETERMINE WHAT YOU ARE AND ATTACK WITH THE PROPER HAND_X PROC -------
if (istype(usr, /mob/living/carbon/human))
src.hand_h(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/monkey))
src.hand_p(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/alien/humanoid))
src.hand_al(usr, usr.hand)
else if (istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot))
src.hand_a(usr, usr.hand)
else
// ------- ITEM INACESSIBLE OR CLICKING ON SCREEN -------
if (istype(src, /obj/screen))
// ------- IT'S THE HUD YOU'RE CLICKING ON -------
usr.prev_move = usr.next_move
usr:lastDblClick = world.time + 2
if (usr.next_move < world.time)
usr.next_move = world.time + 2
else
return
// ------- 2 DECISECOND DELAY FOR CLICKING PASSED -------
if (!( usr.restrained() ))
// ------- YOU ARE NOT RESTRAINED -------
if ((W && !( istype(src, /obj/screen) )))
// ------- IT SHOULD NEVER GET TO HERE, DUE TO THE ISTYPE(SRC, /OBJ/SCREEN) FROM PREVIOUS IF-S - I TESTED IT WITH A DEBUG OUTPUT AND I COULDN'T GET THIST TO SHOW UP. -------
src.attackby(W, usr)
if (W)
W.afterattack(src, usr,, params)
else
// ------- YOU ARE NOT RESTRAINED, AND ARE CLICKING A HUD OBJECT -------
if (istype(usr, /mob/living/carbon/human))
src.attack_hand(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/monkey))
src.attack_paw(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/alien/humanoid))
src.attack_alien(usr, usr.hand)
else
// ------- YOU ARE RESTRAINED CLICKING ON A HUD OBJECT -------
if (istype(usr, /mob/living/carbon/human))
src.hand_h(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/monkey))
src.hand_p(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/alien/humanoid))
src.hand_al(usr, usr.hand)
else
// ------- YOU ARE CLICKING ON AN OBJECT THAT'S INACCESSIBLE TO YOU AND IS NOT YOUR HUD -------
if((LASER in usr:mutations) && usr:a_intent == "harm" && world.time >= usr.next_move)
// ------- YOU HAVE THE LASER MUTATION, YOUR INTENT SET TO HURT AND IT'S BEEN MORE THAN A DECISECOND SINCE YOU LAS TATTACKED -------
var/turf/T = get_turf(usr)
var/turf/U = get_turf(src)
if(istype(usr, /mob/living/carbon/human))
usr:nutrition -= rand(1,5)
usr:handle_regular_hud_updates()
var/obj/item/projectile/beam/A = new /obj/item/projectile/beam( usr.loc )
A.icon = 'icons/effects/genetics.dmi'
A.icon_state = "eyelasers"
playsound(usr.loc, 'sound/weapons/taser2.ogg', 75, 1)
A.firer = usr
A.def_zone = usr:get_organ_target()
A.original = src
A.current = T
A.yo = U.y - T.y
A.xo = U.x - T.x
spawn( 1 )
A.process()
usr.next_move = world.time + 6
return

124
code/_onclick/other_mobs.dm Normal file
View File

@@ -0,0 +1,124 @@
/*
Humans:
Adds an exception for gloves, to allow special glove types like the ninja ones.
Otherwise pretty standard.
*/
/mob/living/carbon/human/UnarmedAttack(var/atom/A, var/proximity)
var/obj/item/clothing/gloves/G = gloves // not typecast specifically enough in defines
// Special glove functions:
// If the gloves do anything, have them return 1 to stop
// normal attack_hand() here.
if(proximity && istype(G) && G.Touch(A,1))
return
A.attack_hand(src)
/atom/proc/attack_hand(mob/user as mob)
return
/mob/living/carbon/human/RestrainedClickOn(var/atom/A)
return
/mob/living/carbon/human/RangedAttack(var/atom/A)
if(!gloves && !mutations.len) return
var/obj/item/clothing/gloves/G = gloves
if((LASER in mutations) && a_intent == "harm")
LaserEyes(A) // moved into a proc below
else if(istype(G) && G.Touch(A,0)) // for magic gloves
return
else if(TK in mutations)
switch(get_dist(src,A))
if(1 to 5) // not adjacent may mean blocked by window
next_move += 2
if(5 to 7)
next_move += 5
if(8 to 15)
next_move += 10
if(16 to 128)
return
A.attack_tk(src)
/*
Animals & All Unspecified
*/
/mob/living/UnarmedAttack(var/atom/A)
A.attack_animal(src)
/atom/proc/attack_animal(mob/user as mob)
return
/mob/living/RestrainedClickOn(var/atom/A)
return
/*
Monkeys
*/
/mob/living/carbon/monkey/UnarmedAttack(var/atom/A)
A.attack_paw(src)
/atom/proc/attack_paw(mob/user as mob)
return
/*
Monkey RestrainedClickOn() was apparently the
one and only use of all of the restrained click code
(except to stop you from doing things while handcuffed);
moving it here instead of various hand_p's has simplified
things considerably
*/
/mob/living/carbon/monkey/RestrainedClickOn(var/atom/A)
if(a_intent != "harm" || !ismob(A)) return
if(istype(wear_mask, /obj/item/clothing/mask/muzzle))
return
var/mob/living/carbon/ML = A
var/dam_zone = ran_zone(pick("chest", "l_hand", "r_hand", "l_leg", "r_leg"))
var/armor = ML.run_armor_check(dam_zone, "melee")
if(prob(75))
ML.apply_damage(rand(1,3), BRUTE, dam_zone, armor)
for(var/mob/O in viewers(ML, null))
O.show_message("\red <B>[name] has bit [ML]!</B>", 1)
if(armor >= 2) return
if(ismonkey(ML))
for(var/datum/disease/D in viruses)
if(istype(D, /datum/disease/jungle_fever))
ML.contract_disease(D,1,0)
else
for(var/mob/O in viewers(ML, null))
O.show_message("\red <B>[src] has attempted to bite [ML]!</B>", 1)
/*
Aliens
Defaults to same as monkey in most places
*/
/mob/living/carbon/alien/UnarmedAttack(var/atom/A)
A.attack_alien(src)
/atom/proc/attack_alien(mob/user as mob)
attack_paw(user)
return
/mob/living/carbon/alien/RestrainedClickOn(var/atom/A)
return
// Babby aliens
/mob/living/carbon/alien/larva/UnarmedAttack(var/atom/A)
A.attack_larva(src)
/atom/proc/attack_larva(mob/user as mob)
return
/*
Slimes
Nothing happening here
*/
/mob/living/carbon/slime/UnarmedAttack(var/atom/A)
A.attack_slime(src)
/atom/proc/attack_slime(mob/user as mob)
return
/mob/living/carbon/slime/RestrainedClickOn(var/atom/A)
return
/*
New Players:
Have no reason to click on anything at all.
*/
/mob/new_player/ClickOn()
return

View File

@@ -0,0 +1,208 @@
/*
Telekinesis
This needs more thinking out, but I might as well.
*/
var/const/tk_maxrange = 15
/*
Telekinetic attack:
By default, emulate the user's unarmed attack
*/
/atom/proc/attack_tk(mob/user)
if(user.stat) return
user.UnarmedAttack(src,0) // attack_hand, attack_paw, etc
return
/*
This is similar to item attack_self, but applies to anything
that you can grab with a telekinetic grab.
It is used for manipulating things at range, for example, opening and closing closets.
There are not a lot of defaults at this time, add more where appropriate.
*/
/atom/proc/attack_self_tk(mob/user)
return
/obj/attack_tk(mob/user)
if(user.stat) return
if(anchored)
..()
return
var/obj/item/tk_grab/O = new(src)
user.put_in_active_hand(O)
O.host = user
O.focus_object(src)
return
/obj/item/attack_tk(mob/user)
if(user.stat || !isturf(loc)) return
if((TK in user.mutations) && !user.get_active_hand()) // both should already be true to get here
var/obj/item/tk_grab/O = new(src)
user.put_in_active_hand(O)
O.host = user
O.focus_object(src)
else
warning("Strange attack_tk(): TK([TK in user.mutations]) empty hand([!user.get_active_hand()])")
return
/mob/attack_tk(mob/user)
return // needs more thinking about
/*
TK Grab Item (the workhorse of old TK)
* If you have not grabbed something, do a normal tk attack
* If you have something, throw it at the target. If it is already adjacent, do a normal attackby()
* If you click what you are holding, or attack_self(), do an attack_self_tk() on it.
* Deletes itself if it is ever not in your hand, or if you should have no access to TK.
*/
/obj/item/tk_grab
name = "Telekinetic Grab"
desc = "Magic"
icon = 'icons/obj/magic.dmi'//Needs sprites
icon_state = "2"
flags = NOBLUDGEON
//item_state = null
w_class = 10.0
layer = 20
var/last_throw = 0
var/atom/movable/focus = null
var/mob/living/host = null
dropped(mob/user as mob)
if(focus && user && loc != user && loc != user.loc) // drop_item() gets called when you tk-attack a table/closet with an item
if(focus.Adjacent(loc))
focus.loc = loc
del(src)
return
//stops TK grabs being equipped anywhere but into hands
equipped(var/mob/user, var/slot)
if( (slot == slot_l_hand) || (slot== slot_r_hand) ) return
del(src)
return
attack_self(mob/user as mob)
if(focus)
focus.attack_self_tk(user)
afterattack(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, proximity)//TODO: go over this
if(!target || !user) return
if(last_throw+3 > world.time) return
if(!host || host != user)
del(src)
return
if(!(TK in host.mutations))
del(src)
return
if(isobj(target) && !isturf(target.loc))
return
var/d = get_dist(user, target)
if(focus) d = max(d,get_dist(user,focus)) // whichever is further
switch(d)
if(0)
;
if(1 to 5) // not adjacent may mean blocked by window
if(!proximity)
user.next_move += 2
if(5 to 7)
user.next_move += 5
if(8 to tk_maxrange)
user.next_move += 10
else
user << "\blue Your mind won't reach that far."
return
if(!focus)
focus_object(target, user)
return
if(target == focus)
target.attack_self_tk(user)
return // todo: something like attack_self not laden with assumptions inherent to attack_self
if(!istype(target, /turf) && istype(focus,/obj/item) && target.Adjacent(focus))
var/obj/item/I = focus
var/resolved = target.attackby(I, user, user:get_organ_target())
if(!resolved && target && I)
I.afterattack(target,user,1) // for splashing with beakers
else
apply_focus_overlay()
focus.throw_at(target, 10, 1)
last_throw = world.time
return
attack(mob/living/M as mob, mob/living/user as mob, def_zone)
return
proc/focus_object(var/obj/target, var/mob/living/user)
if(!istype(target,/obj)) return//Cant throw non objects atm might let it do mobs later
if(target.anchored || !isturf(target.loc))
del src
return
focus = target
update_icon()
apply_focus_overlay()
return
proc/apply_focus_overlay()
if(!focus) return
var/obj/effect/overlay/O = new /obj/effect/overlay(locate(focus.x,focus.y,focus.z))
O.name = "sparkles"
O.anchored = 1
O.density = 0
O.layer = FLY_LAYER
O.dir = pick(cardinal)
O.icon = 'icons/effects/effects.dmi'
O.icon_state = "nothing"
flick("empdisable",O)
spawn(5)
O.delete()
return
update_icon()
overlays.Cut()
if(focus && focus.icon && focus.icon_state)
overlays += icon(focus.icon,focus.icon_state)
return
/*Not quite done likely needs to use something thats not get_step_to
proc/check_path()
var/turf/ref = get_turf(src.loc)
var/turf/target = get_turf(focus.loc)
if(!ref || !target) return 0
var/distance = get_dist(ref, target)
if(distance >= 10) return 0
for(var/i = 1 to distance)
ref = get_step_to(ref, target, 0)
if(ref != target) return 0
return 1
*/
//equip_to_slot_or_del(obj/item/W, slot, del_on_fail = 1)
/*
if(istype(user, /mob/living/carbon))
if(user:mutations & TK && get_dist(source, user) <= 7)
if(user:get_active_hand()) return 0
var/X = source:x
var/Y = source:y
var/Z = source:z
*/

View File

@@ -206,12 +206,16 @@ datum/controller/vote
return 0
choices.Add(config.votable_modes)
if("crew_transfer")
if (get_security_level() == "red" || get_security_level() == "delta")
return 0
if(ticker.current_state <= 2)
return 0
question = "End the shift?"
choices.Add("Initiate Crew Transfer", "Continue The Round")
if(check_rights(R_ADMIN) || check_rights(R_MOD))
question = "End the shift?"
choices.Add("Initiate Crew Transfer", "Continue The Round")
else
if (get_security_level() == "red" || get_security_level() == "delta")
return 0
if(ticker.current_state <= 2)
return 0
question = "End the shift?"
choices.Add("Initiate Crew Transfer", "Continue The Round")
if("custom")
question = html_encode(input(usr,"What is the vote for?") as text|null)
if(!question) return 0
@@ -236,10 +240,10 @@ datum/controller/vote
world << sound('sound/ambience/alarm4.ogg')
if("custom")
world << sound('sound/ambience/alarm4.ogg')
/* if(mode == "gamemode" && going)
if(mode == "gamemode" && going)
going = 0
world << "<font color='red'><b>Round start has been delayed.</b></font>"
if(mode == "crew_transfer" && ooc_allowed)
/* if(mode == "crew_transfer" && ooc_allowed)
auto_muted = 1
ooc_allowed = !( ooc_allowed )
world << "<b>The OOC channel has been automatically disabled due to a crew transfer vote.</b>"

View File

@@ -118,12 +118,9 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
charge_counter = charge_max
/obj/effect/proc_holder/spell/Click()
..()
if(!cast_check())
return
choose_targets()
if(cast_check())
choose_targets()
return 1
/obj/effect/proc_holder/spell/proc/choose_targets(mob/user = usr) //depends on subtype - /targeted or /aoe_turf
return

View File

@@ -980,6 +980,24 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
group = "Engineering"
access = access_engine
/datum/supply_packs/air_dispenser
contains = list(/obj/machinery/pipedispenser/orderable)
name = "Pipe Dispenser"
cost = 35
containertype = /obj/structure/closet/crate/secure/large
containername = "Pipe Dispenser Crate"
group = "Engineering"
access = access_atmospherics
/datum/supply_packs/disposals_dispenser
contains = list(/obj/machinery/pipedispenser/disposal/orderable)
name = "Disposals Pipe Dispenser"
cost = 35
containertype = /obj/structure/closet/crate/secure/large
containername = "Disposal Dispenser Crate"
group = "Engineering"
access = access_atmospherics
/datum/supply_packs/bee_keeper
name = "Beekeeping Crate"
contains = list(/obj/item/beezeez,

View File

@@ -262,7 +262,7 @@
throwforce = 0.0
throw_speed = 1
throw_range = 20
flags = FPRINT | USEDELAY | TABLEPASS | CONDUCT
flags = FPRINT | TABLEPASS | CONDUCT
afterattack(atom/target as mob|obj|turf|area, mob/user as mob)
user.drop_item()
src.throw_at(target, throw_range, throw_speed)

View File

@@ -1293,7 +1293,7 @@
name = "weed-spray"
icon_state = "weedspray"
item_state = "spray"
flags = TABLEPASS | OPENCONTAINER | FPRINT | USEDELAY
flags = TABLEPASS | OPENCONTAINER | FPRINT | NOBLUDGEON
slot_flags = SLOT_BELT
throwforce = 4
w_class = 2.0
@@ -1312,7 +1312,7 @@
name = "pest-spray"
icon_state = "pestspray"
item_state = "spray"
flags = TABLEPASS | OPENCONTAINER | FPRINT | USEDELAY
flags = TABLEPASS | OPENCONTAINER | FPRINT | NOBLUDGEON
slot_flags = SLOT_BELT
throwforce = 4
w_class = 2.0
@@ -1331,7 +1331,7 @@
icon = 'icons/obj/weapons.dmi'
icon_state = "hoe"
item_state = "hoe"
flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY
flags = FPRINT | TABLEPASS | CONDUCT | NOBLUDGEON
force = 5.0
throwforce = 7.0
w_class = 2.0

View File

@@ -188,20 +188,6 @@
item_state = "card-id"
w_class = 1.0
//TODO: Figure out wtf this is and possibly remove it -Nodrak
/obj/item/weapon/dummy
name = "dummy"
invisibility = 101.0
anchored = 1.0
flags = TABLEPASS
/obj/item/weapon/dummy/ex_act()
return
/obj/item/weapon/dummy/blob_act()
return
/*
/obj/item/weapon/game_kit
name = "Gaming Kit"
@@ -578,7 +564,8 @@
origin_tech = "materials=2;combat=2"
attack_verb = list("chopped", "sliced", "cut", "reaped")
/obj/item/weapon/scythe/afterattack(atom/A, mob/user as mob)
/obj/item/weapon/scythe/afterattack(atom/A, mob/user as mob, proximity)
if(!proximity) return
if(istype(A, /obj/effect/spacevine))
for(var/obj/effect/spacevine/B in orange(A,1))
if(prob(80))
@@ -612,7 +599,7 @@
icon = 'icons/obj/assemblies.dmi'
icon_state = "plastic-explosive0"
item_state = "plasticx"
flags = FPRINT | TABLEPASS | USEDELAY
flags = FPRINT | TABLEPASS | NOBLUDGEON
w_class = 2.0
origin_tech = "syndicate=2"
var/timer = 10

View File

@@ -222,9 +222,6 @@ its easier to just keep the beam vertical.
//usr << "[name]: Dn:[density] dir:[dir] cont:[contents] icon:[icon] is:[icon_state] loc:[loc]"
return
/atom/proc/MouseDrop_T()
return
/atom/proc/relaymove()
return
@@ -237,75 +234,9 @@ its easier to just keep the beam vertical.
/atom/proc/fire_act()
return
/atom/proc/attack_hand(mob/user as mob)
return
/atom/proc/attack_paw(mob/user as mob)
return
/atom/proc/attack_ai(mob/user as mob)
return
/atom/proc/attack_robot(mob/user as mob)
attack_ai(user)
return
/atom/proc/attack_animal(mob/user as mob)
return
/atom/proc/attack_ghost(mob/user as mob)
src.examine()
return
/atom/proc/attack_admin(mob/user as mob)
if(!user || !user.client || !user.client.holder)
return
attack_hand(user)
//for aliens, it works the same as monkeys except for alien-> mob interactions which will be defined in the
//appropiate mob files
/atom/proc/attack_alien(mob/user as mob)
src.attack_paw(user)
return
/atom/proc/attack_larva(mob/user as mob)
return
// for slimes
/atom/proc/attack_slime(mob/user as mob)
return
/atom/proc/hand_h(mob/user as mob) //human (hand) - restrained
return
/atom/proc/hand_p(mob/user as mob) //monkey (paw) - restrained
return
/atom/proc/hand_a(mob/user as mob) //AI - restrained
return
/atom/proc/hand_r(mob/user as mob) //Cyborg (robot) - restrained
src.hand_a(user)
return
/atom/proc/hand_al(mob/user as mob) //alien - restrained
src.hand_p(user)
return
/atom/proc/hand_m(mob/user as mob) //slime - restrained
return
/atom/proc/hitby(atom/movable/AM as mob|obj)
return
/atom/proc/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (!(istype(W, /obj/item/weapon/grab) ) && !(istype(W, /obj/item/weapon/plastique)) && !(istype(W, /obj/item/weapon/reagent_containers/spray)) && !(istype(W, /obj/item/weapon/packageWrap)) && !istype(W, /obj/item/device/detective_scanner))
for(var/mob/O in viewers(src, null))
if ((O.client && !( O.blinded )))
O << "\red <B>[src] has been hit by [user] with [W]</B>"
return
/atom/proc/add_hiddenprint(mob/living/M as mob)
if(isnull(M)) return
if(isnull(M.key)) return
@@ -418,6 +349,7 @@ its easier to just keep the beam vertical.
//returns 1 if made bloody, returns 0 otherwise
/atom/proc/add_blood(mob/living/carbon/human/M as mob)
if(flags & NOBLOODY) return 0
.=1
if (!( istype(M, /mob/living/carbon/human) ))
return 0
@@ -457,812 +389,6 @@ its easier to just keep the beam vertical.
return 1
/atom/MouseDrop(atom/over_object as mob|obj|turf|area)
spawn(0)
if (istype(over_object, /atom))
over_object.MouseDrop_T(src, usr)
return
..()
return
/atom/Click(location,control,params)
//world << "atom.Click() on [src] by [usr] : src.type is [src.type]"
var/acting_bad = 1 //Check for gun targeting code.
if (istype(src,/obj/item/weapon/gun)) //Allow people to lower weapon
acting_bad = 0
if (istype(src, /turf) && istype(usr,/mob/living/carbon/human)) //Allow people to turn around
var/mob/living/carbon/human/H = usr
if (!H.equipped())
acting_bad = 0
if(acting_bad)
usr.last_target_click = world.time
if(usr.client.buildmode)
build_click(usr, usr.client.buildmode, location, control, params, src)
return
// if(using_new_click_proc) //TODO ERRORAGE (see message below)
// return DblClickNew()
return DblClick(location, control, params)
var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblClickNew() proc is being tested)
/atom/proc/DblClickNew()
if(!usr) return
// TODO DOOHL: Intergrate params to new proc. Saved for another time because var/valid_place is a fucking brainfuck
//Spamclick server-overloading prevention delay... THING
if (world.time <= usr:lastDblClick+1)
return
else
usr:lastDblClick = world.time
//paralysis and critical condition
if(usr.stat == 1) //Death is handled in attack_ghost()
return
if(!istype(usr, /mob/living/silicon/ai))
if (usr.paralysis || usr.stunned || usr.weakened)
return
//handle the hud separately
if(istype(src,/obj/screen))
if( usr.restrained() )
if(ishuman(usr))
src.attack_hand(usr)
else if(isAI(usr))
src.attack_ai(usr)
else if(isrobot(usr))
src.attack_ai(usr)
else if(isobserver(usr))
src.attack_ghost(usr)
else if(ismonkey(usr))
src.attack_paw(usr)
else if(isalienadult(usr))
src.attack_alien(usr)
else if(isslime(usr))
src.attack_slime(usr)
else if(isanimal(usr))
src.attack_animal(usr)
else
usr << "This mob type does not support clicks to the HUD. Contact a coder."
else
if(ishuman(usr))
src.hand_h(usr, usr.hand)
else if(isAI(usr))
src.hand_a(usr, usr.hand)
else if(isrobot(usr))
src.hand_a(usr, usr.hand)
else if(isobserver(usr))
return
else if(ismonkey(usr))
src.hand_p(usr, usr.hand)
else if(isalienadult(usr))
src.hand_al(usr, usr.hand)
else if(isslime(usr))
return
else if(isanimal(usr))
return
else
usr << "This mob type does not support restrained clicks to the HUD. Contact a coder."
return
//Gets equipped item or used module of robots
var/obj/item/W = usr.get_active_hand()
//Attack self
if (W == src && usr.stat == 0)
// spawn (0) //causes runtimes under heavy lag
W.attack_self(usr)
return
//Attackby, attack_hand, afterattack, etc. can only be done once every 1 second, unless an object has the NODELAY or USEDELAY flags set
//This segment of code determins this.
if(W)
if( !( (src.loc && src.loc == usr) || (src.loc.loc && src.loc.loc == usr) ) )
//The check above checks that you are not targeting an item which you are holding.
//If you are, (example clicking a backpack), the delays are ignored.
if(W.flags & USEDELAY)
//Objects that use the USEDELAY flag can only attack once every 2 seconds
if (usr.next_move < world.time)
usr.prev_move = usr.next_move
usr.next_move = world.time + 20
else
return //A click has recently been handled already, you need to wait until the anti-spam delay between clicks passes
else if(!(W.flags & NODELAY))
//Objects with NODELAY don't have a delay between uses, while most objects have the standard 1 second delay.
if (usr.next_move < world.time)
usr.prev_move = usr.next_move
usr.next_move = world.time + 10
else
return //A click has recently been handled already, you need to wait until the anti-spam delay between clicks passes
else
//Empty hand
if (usr.next_move < world.time)
usr.prev_move = usr.next_move
usr.next_move = world.time + 10
else
return //A click has recently been handled already, you need to wait until the anti-spam delay between clicks passes
//Is the object in a valid place?
var/valid_place = 0
if ( isturf(src) || ( src.loc && isturf(src.loc) ) || ( src.loc.loc && isturf(src.loc.loc) ) )
//Object is either a turf of placed on a turf, thus valid.
//The third one is that it is in a container, which is on a turf, like a box,
//which you mouse-drag opened. Also a valid location.
valid_place = 1
if ( ( src.loc && (src.loc == usr) ) || ( src.loc.loc && (src.loc.loc == usr) ) )
//User has the object on them (in their inventory) and it is thus valid
valid_place = 1
//Afterattack gets performed every time you click, no matter if it's in range or not. It's used when
//clicking targets for guns and such. If you are clicking on a target that's not in range
//with an item in your hands only afterattack() needs to be performed.
//If the range is valid, afterattack() will be handled in the separate mob-type
//sections below, however only after attackby(). Attack_hand and simmilar procs are handled
//in the mob-type sections below, as some require you to be in range to work (human, monkey..) while others don't (ai, cyborg)
//Also note that afterattack does not differentiate between the holder/attacker's mob-type.
if( W && !valid_place)
W.afterattack(src, usr, (valid_place ? 1 : 0))
return
if(ishuman(usr))
var/mob/living/carbon/human/human = usr
//-human stuff-
if(human.stat)
return
if(human.in_throw_mode)
return human.throw_item(src)
var/in_range = in_range(src, human) || src.loc == human
if (in_range)
if (!( human.restrained() || human.lying ))
if (W)
var/was_used = 0
if(W)
was_used = W.is_used_on(src, human)
if(!was_used)
attackby(W,human)
if (W)
W.afterattack(src, human)
else
attack_hand(human)
else
hand_h(human, human.hand)
else
if ( (W) && !human.restrained() )
W.afterattack(src, human)
else if(isAI(usr))
var/mob/living/silicon/ai/ai = usr
//-ai stuff-
if(ai.stat)
return
if (ai.control_disabled)
return
if( !ai.restrained() )
attack_ai(ai)
else
hand_a(ai, ai.hand)
else if(isrobot(usr))
var/mob/living/silicon/robot/robot = usr
//-cyborg stuff-
if(robot.stat)
return
if (robot.lockcharge)
return
if(W)
var/in_range = in_range(src, robot) || src.loc == robot
if(in_range)
attackby(W,robot)
if (W)
W.afterattack(src, robot)
else
if( !robot.restrained() )
attack_robot(robot)
else
hand_r(robot, robot.hand)
else if(isobserver(usr))
var/mob/dead/observer/ghost = usr
//-ghost stuff-
if(ghost)
if(W)
if(usr.client && usr.client.holder)
src.attackby(W, ghost) //This is so admins can interact with things ingame.
else
src.attack_ghost(ghost) //Something's gone wrong, non-admin ghosts shouldn't be able to hold things.
else
if(usr.client && usr.client.holder)
src.attack_admin(ghost) //This is so admins can interact with things ingame.
else
src.attack_ghost(ghost) //Standard click as ghost
else if(ismonkey(usr))
var/mob/living/carbon/monkey/monkey = usr
//-monkey stuff-
if(monkey.stat)
return
if(monkey.in_throw_mode)
return monkey.throw_item(src)
var/in_range = in_range(src, monkey) || src.loc == monkey
if (in_range)
if ( !monkey.restrained() )
if (W)
attackby(W,monkey)
if (W)
W.afterattack(src, monkey)
else
attack_paw(monkey)
else
hand_p(monkey, monkey.hand)
else
if ( (W) && !monkey.restrained() )
W.afterattack(src, monkey)
else if(isalienadult(usr))
var/mob/living/carbon/alien/humanoid/alien = usr
//-alien stuff-
if(alien.stat)
return
var/in_range = in_range(src, alien) || src.loc == alien
if (in_range)
if ( !alien.restrained() )
if (W)
attackby(W,alien)
if (W)
W.afterattack(src, alien)
else
attack_alien(alien)
else
hand_al(alien, alien.hand)
else
if ( (W) && !alien.restrained() )
W.afterattack(src, alien)
else if(islarva(usr))
var/mob/living/carbon/alien/larva/alien = usr
if(alien.stat)
return
var/in_range = in_range(src, alien) || src.loc == alien
if (in_range)
if ( !alien.restrained() )
attack_larva(alien)
else if(isslime(usr))
var/mob/living/carbon/slime/slime = usr
//-slime stuff-
if(slime.stat)
return
var/in_range = in_range(src, slime) || src.loc == slime
if (in_range)
if ( !slime.restrained() )
if (W)
attackby(W,slime)
if (W)
W.afterattack(src, slime)
else
attack_slime(slime)
else
hand_m(slime, slime.hand)
else
if ( (W) && !slime.restrained() )
W.afterattack(src, slime)
else if(isanimal(usr))
var/mob/living/simple_animal/animal = usr
//-simple animal stuff-
if(animal.stat)
return
var/in_range = in_range(src, animal) || src.loc == animal
if (in_range)
if ( !animal.restrained() )
attack_animal(animal)
/atom/DblClick(location, control, params) //TODO: DEFERRED: REWRITE
if(!usr) return
// ------- TIME SINCE LAST CLICK -------
if (world.time <= usr:lastDblClick+1)
// world << "BLOCKED atom.DblClick() on [src] by [usr] : src.type is [src.type]"
return
else
// world << "atom.DblClick() on [src] by [usr] : src.type is [src.type]"
usr:lastDblClick = world.time
//Putting it here for now. It diverts stuff to the mech clicking procs. Putting it here stops us drilling items in our inventory Carn
if(istype(usr.loc,/obj/mecha))
if(usr.client && (src in usr.client.screen))
return
var/obj/mecha/Mech = usr.loc
Mech.click_action(src,usr)
return
// ------- DIR CHANGING WHEN CLICKING ------
if( iscarbon(usr) && !usr.buckled )
if( src.x && src.y && usr.x && usr.y )
var/dx = src.x - usr.x
var/dy = src.y - usr.y
if(dy || dx)
if(abs(dx) < abs(dy))
if(dy > 0) usr.dir = NORTH
else usr.dir = SOUTH
else
if(dx > 0) usr.dir = EAST
else usr.dir = WEST
else
if(pixel_y > 16) usr.dir = NORTH
else if(pixel_y < -16) usr.dir = SOUTH
else if(pixel_x > 16) usr.dir = EAST
else if(pixel_x < -16) usr.dir = WEST
// ------- AI -------
else if (istype(usr, /mob/living/silicon/ai))
var/mob/living/silicon/ai/ai = usr
if (ai.control_disabled)
return
// ------- CYBORG -------
else if (istype(usr, /mob/living/silicon/robot))
var/mob/living/silicon/robot/bot = usr
if (bot.lockcharge) return
..()
// ------- SHIFT-CLICK -------
if(params)
var/parameters = params2list(params)
if(parameters["shift"]){
if(!isAI(usr))
ShiftClick(usr)
else
AIShiftClick(usr)
return
}
// ------- ALT-CLICK -------
if(parameters["alt"]){
if(!isAI(usr))
AltClick(usr)
else
AIAltClick(usr)
return
}
// ------- CTRL-CLICK -------
if(parameters["ctrl"]){
if(!isAI(usr))
CtrlClick(usr)
else
AICtrlClick(usr)
return
}
// ------- MIDDLE-CLICK -------
if(parameters["middle"]){
if(!isAI(usr))
MiddleClick(usr)
return
}
// ------- THROW -------
if(usr.in_throw_mode)
return usr:throw_item(src)
// ------- ITEM IN HAND DEFINED -------
var/obj/item/W = usr.get_active_hand()
/* Now handled by get_active_hand()
// ------- ROBOT -------
if(istype(usr, /mob/living/silicon/robot))
if(!isnull(usr:module_active))
W = usr:module_active
else
W = null
*/
// ------- ATTACK SELF -------
if (W == src && usr.stat == 0)
W.attack_self(usr)
if(usr.hand)
usr.update_inv_l_hand() //update in-hand overlays
else
usr.update_inv_r_hand()
return
// ------- PARALYSIS, STUN, WEAKENED, DEAD, (And not AI) -------
if (((usr.paralysis || usr.stunned || usr.weakened) && !istype(usr, /mob/living/silicon/ai)) || usr.stat != 0)
return
// ------- CLICKING STUFF IN CONTAINERS -------
if ((!( src in usr.contents ) && (((!( isturf(src) ) && (!( isturf(src.loc) ) && (src.loc && !( isturf(src.loc.loc) )))) || !( isturf(usr.loc) )) && (src.loc != usr.loc && (!( istype(src, /obj/screen) ) && !( usr.contents.Find(src.loc) ))))))
if (istype(usr, /mob/living/silicon/ai))
var/mob/living/silicon/ai/ai = usr
if (ai.control_disabled || ai.malfhacking)
return
else
return
// ------- 1 TILE AWAY -------
var/t5
// ------- AI CAN CLICK ANYTHING -------
if(istype(usr, /mob/living/silicon/ai))
t5 = 1
// ------- CYBORG CAN CLICK ANYTHING WHEN NOT HOLDING STUFF -------
else if(istype(usr, /mob/living/silicon/robot) && !W)
t5 = 1
else
t5 = in_range(src, usr) || src.loc == usr
// world << "according to dblclick(), t5 is [t5]"
// ------- ACTUALLY DETERMINING STUFF -------
if (((t5 || (W && (W.flags & USEDELAY))) && !( istype(src, /obj/screen) )))
// ------- ( CAN USE ITEM OR HAS 1 SECOND USE DELAY ) AND NOT CLICKING ON SCREEN -------
if (usr.next_move < world.time)
usr.prev_move = usr.next_move
usr.next_move = world.time + 10
else
// ------- ALREADY USED ONE ITEM WITH USE DELAY IN THE PREVIOUS SECOND -------
return
// ------- DELAY CHECK PASSED -------
if ((src.loc && (get_dist(src, usr) < 2 || src.loc == usr.loc)))
// ------- CLICKED OBJECT EXISTS IN GAME WORLD, DISTANCE FROM PERSON TO OBJECT IS 1 SQUARE OR THEY'RE ON THE SAME SQUARE -------
var/direct = get_dir(usr, src)
var/obj/item/weapon/dummy/D = new /obj/item/weapon/dummy( usr.loc )
var/ok = 0
if ( (direct - 1) & direct)
// ------- CLICKED OBJECT IS LOCATED IN A DIAGONAL POSITION FROM THE PERSON -------
var/turf/Step_1
var/turf/Step_2
switch(direct)
if(5.0)
Step_1 = get_step(usr, NORTH)
Step_2 = get_step(usr, EAST)
if(6.0)
Step_1 = get_step(usr, SOUTH)
Step_2 = get_step(usr, EAST)
if(9.0)
Step_1 = get_step(usr, NORTH)
Step_2 = get_step(usr, WEST)
if(10.0)
Step_1 = get_step(usr, SOUTH)
Step_2 = get_step(usr, WEST)
else
if(Step_1 && Step_2)
// ------- BOTH CARDINAL DIRECTIONS OF THE DIAGONAL EXIST IN THE GAME WORLD -------
var/check_1 = 0
var/check_2 = 0
if(step_to(D, Step_1))
check_1 = 1
for(var/obj/border_obstacle in Step_1)
if(border_obstacle.flags & ON_BORDER)
if(!border_obstacle.CheckExit(D, src))
check_1 = 0
// ------- YOU TRIED TO CLICK ON AN ITEM THROUGH A WINDOW (OR SIMILAR THING THAT LIMITS ON BORDERS) ON ONE OF THE DIRECITON TILES -------
for(var/obj/border_obstacle in get_turf(src))
if((border_obstacle.flags & ON_BORDER) && (src != border_obstacle))
if(!border_obstacle.CanPass(D, D.loc, 1, 0))
// ------- YOU TRIED TO CLICK ON AN ITEM THROUGH A WINDOW (OR SIMILAR THING THAT LIMITS ON BORDERS) ON THE TILE YOU'RE ON -------
check_1 = 0
D.loc = usr.loc
if(step_to(D, Step_2))
check_2 = 1
for(var/obj/border_obstacle in Step_2)
if(border_obstacle.flags & ON_BORDER)
if(!border_obstacle.CheckExit(D, src))
check_2 = 0
for(var/obj/border_obstacle in get_turf(src))
if((border_obstacle.flags & ON_BORDER) && (src != border_obstacle))
if(!border_obstacle.CanPass(D, D.loc, 1, 0))
check_2 = 0
if(check_1 || check_2)
ok = 1
// ------- YOU CAN REACH THE ITEM THROUGH AT LEAST ONE OF THE TWO DIRECTIONS. GOOD. -------
/*
More info:
If you're trying to click an item in the north-east of your mob, the above section of code will first check if tehre's a tile to the north or you and to the east of you
These two tiles are Step_1 and Step_2. After this, a new dummy object is created on your location. It then tries to move to Step_1, If it succeeds, objects on the turf you're on and
the turf that Step_1 is are checked for items which have the ON_BORDER flag set. These are itmes which limit you on only one tile border. Windows, for the most part.
CheckExit() and CanPass() are use to determine this. The dummy object is then moved back to your location and it tries to move to Step_2. Same checks are performed here.
If at least one of the two checks succeeds, it means you can reach the item and ok is set to 1.
*/
else
// ------- OBJECT IS ON A CARDINAL TILE (NORTH, SOUTH, EAST OR WEST OR THE TILE YOU'RE ON) -------
if(loc == usr.loc)
ok = 1
// ------- OBJECT IS ON THE SAME TILE AS YOU -------
else
ok = 1
//Now, check objects to block exit that are on the border
for(var/obj/border_obstacle in usr.loc)
if(border_obstacle.flags & ON_BORDER)
if(!border_obstacle.CheckExit(D, src))
ok = 0
//Next, check objects to block entry that are on the border
for(var/obj/border_obstacle in get_turf(src))
if((border_obstacle.flags & ON_BORDER) && (src != border_obstacle))
if(!border_obstacle.CanPass(D, D.loc, 1, 0))
ok = 0
/*
See the previous More info, for... more info...
*/
//del(D)
// Garbage Collect Dummy
D.loc = null
D = null
// ------- DUMMY OBJECT'S SERVED IT'S PURPOSE, IT'S REWARDED WITH A SWIFT DELETE -------
if (!( ok ))
// ------- TESTS ABOVE DETERMINED YOU CANNOT REACH THE TILE -------
return 0
if (!( usr.restrained() || (usr.lying && usr.buckled!=src) ))
// ------- YOU ARE NOT REASTRAINED -------
if (W)
// ------- YOU HAVE AN ITEM IN YOUR HAND - HANDLE ATTACKBY AND AFTERATTACK -------
if (t5)
src.attackby(W, usr)
if (W)
W.afterattack(src, usr, (t5 ? 1 : 0), params)
else
// ------- YOU DO NOT HAVE AN ITEM IN YOUR HAND -------
if (istype(usr, /mob/living/carbon/human))
// ------- YOU ARE HUMAN -------
src.attack_hand(usr, usr.hand)
else
// ------- YOU ARE NOT HUMAN. WHAT ARE YOU - DETERMINED HERE AND PROPER ATTACK_MOBTYPE CALLED -------
if (istype(usr, /mob/living/carbon/monkey))
src.attack_paw(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/alien/humanoid))
if(usr.m_intent == "walk" && istype(usr, /mob/living/carbon/alien/humanoid/hunter))
usr.m_intent = "run"
usr.hud_used.move_intent.icon_state = "running"
usr.update_icons()
src.attack_alien(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/alien/larva))
src.attack_larva(usr)
else if (istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot))
src.attack_ai(usr, usr.hand)
else if(istype(usr, /mob/living/carbon/slime))
src.attack_slime(usr)
else if(istype(usr, /mob/living/simple_animal))
src.attack_animal(usr)
else
// ------- YOU ARE RESTRAINED. DETERMINE WHAT YOU ARE AND ATTACK WITH THE PROPER HAND_X PROC -------
if (istype(usr, /mob/living/carbon/human))
src.hand_h(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/monkey))
src.hand_p(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/alien/humanoid))
src.hand_al(usr, usr.hand)
else if (istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot))
src.hand_a(usr, usr.hand)
else
// ------- ITEM INACESSIBLE OR CLICKING ON SCREEN -------
if (istype(src, /obj/screen))
// ------- IT'S THE HUD YOU'RE CLICKING ON -------
usr.prev_move = usr.next_move
usr:lastDblClick = world.time + 2
if (usr.next_move < world.time)
usr.next_move = world.time + 2
else
return
// ------- 2 DECISECOND DELAY FOR CLICKING PASSED -------
if (!( usr.restrained() ))
// ------- YOU ARE NOT RESTRAINED -------
if ((W && !( istype(src, /obj/screen) )))
// ------- IT SHOULD NEVER GET TO HERE, DUE TO THE ISTYPE(SRC, /OBJ/SCREEN) FROM PREVIOUS IF-S - I TESTED IT WITH A DEBUG OUTPUT AND I COULDN'T GET THIST TO SHOW UP. -------
src.attackby(W, usr)
if (W)
W.afterattack(src, usr,, params)
else
// ------- YOU ARE NOT RESTRAINED, AND ARE CLICKING A HUD OBJECT -------
if (istype(usr, /mob/living/carbon/human))
src.attack_hand(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/monkey))
src.attack_paw(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/alien/humanoid))
src.attack_alien(usr, usr.hand)
else
// ------- YOU ARE RESTRAINED CLICKING ON A HUD OBJECT -------
if (istype(usr, /mob/living/carbon/human))
src.hand_h(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/monkey))
src.hand_p(usr, usr.hand)
else if (istype(usr, /mob/living/carbon/alien/humanoid))
src.hand_al(usr, usr.hand)
else
// ------- YOU ARE CLICKING ON AN OBJECT THAT'S INACCESSIBLE TO YOU AND IS NOT YOUR HUD -------
if((LASER in usr:mutations) && usr:a_intent == "hurt" && world.time >= usr.next_move)
// ------- YOU HAVE THE LASER MUTATION, YOUR INTENT SET TO HURT AND IT'S BEEN MORE THAN A DECISECOND SINCE YOU LAS TATTACKED -------
var/turf/T = get_turf(usr)
var/turf/U = get_turf(src)
if(istype(usr, /mob/living/carbon/human))
usr:nutrition -= rand(1,5)
usr:handle_regular_hud_updates()
var/obj/item/projectile/beam/A = new /obj/item/projectile/beam( usr.loc )
A.icon = 'icons/effects/genetics.dmi'
A.icon_state = "eyelasers"
playsound(usr.loc, 'sound/weapons/taser2.ogg', 75, 1)
A.firer = usr
A.def_zone = usr:get_organ_target()
A.original = src
A.current = T
A.yo = U.y - T.y
A.xo = U.x - T.x
spawn( 1 )
A.process()
usr.next_move = world.time + 6
return
/atom/proc/ShiftClick(var/mob/M as mob)
if(istype(M.machine, /obj/machinery/computer/security)) //No examining by looking through cameras
return
//I dont think this was ever really a problem and it's only creating more bugs...
// if(( abs(src.x-M.x)<8 || abs(src.y-M.y)<8 ) && src.z == M.z ) //This should prevent non-observers to examine stuff from outside their view.
examine()
return
/atom/proc/AltClick()
/* // NOT UNTIL I FIGURE OUT A GOOD WAY TO DO THIS SHIT
if((HULK in usr.mutations) || (SUPRSTR in usr.augmentations))
if(!istype(src, /obj/item) && !istype(src, /mob) && !istype(src, /turf))
if(!usr.get_active_hand())
var/liftable = 0
for(var/x in liftable_structures)
if(findtext("[src.type]", "[x]"))
liftable = 1
break
if(liftable)
add_fingerprint(usr)
var/obj/item/weapon/grab/G = new /obj/item/weapon/grab(usr)
G.assailant = usr
usr.put_in_active_hand(G)
G.structure = src
G.synch()
visible_message("\red [usr] has picked up [src]!")
return
else
usr << "\red You can't pick this up!"
*/
return
/atom/proc/CtrlClick()
if(hascall(src,"pull"))
src:pull()
return
/atom/proc/AIShiftClick() // Opens and closes doors!
if(istype(src , /obj/machinery/door/airlock))
if(src:density)
var/nhref = "src=\ref[src];aiEnable=7"
src.Topic(nhref, params2list(nhref), src, 1)
else
var/nhref = "src=\ref[src];aiDisable=7"
src.Topic(nhref, params2list(nhref), src, 1)
return
/atom/proc/AIAltClick() // Eletrifies doors.
if(istype(src , /obj/machinery/door/airlock))
if(!src:secondsElectrified)
var/nhref = "src=\ref[src];aiEnable=6"
src.Topic(nhref, params2list(nhref), src, 1)
else
var/nhref = "src=\ref[src];aiDisable=5"
src.Topic(nhref, params2list(nhref), src, 1)
return
/atom/proc/AICtrlClick() // Bolts doors, turns off APCs.
if(istype(src , /obj/machinery/door/airlock))
if(src:locked)
var/nhref = "src=\ref[src];aiEnable=4"
src.Topic(nhref, params2list(nhref), src, 1)
else
var/nhref = "src=\ref[src];aiDisable=4"
src.Topic(nhref, params2list(nhref), src, 1)
else if (istype(src , /obj/machinery/power/apc/))
var/nhref = "src=\ref[src];breaker=1"
src.Topic(nhref, params2list(nhref), 0)
return
/atom/proc/MiddleClick(var/mob/M as mob) // switch hands
if(istype(M, /mob/living/carbon))
var/mob/living/carbon/U = M
U.swap_hand()
/atom/proc/get_global_map_pos()
if(!islist(global_map) || isemptylist(global_map)) return
var/cur_x = null
@@ -1281,16 +407,3 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl
/atom/proc/checkpass(passflag)
return pass_flags&passflag
/*
/client/verb/check_dummy()
set name = "List Dummies"
set category = "Debug"
var/list/dummies = list()
for(var/obj/item/weapon/dummy/D in world)
usr << "[D] - [D.x], [D.y], [D.z] - [D.loc]"
dummies += D
usr << "[dummies.len] found!"
*/

View File

@@ -150,7 +150,7 @@
//done throwing, either because it hit something or it finished moving
src.throwing = 0
if(isobj(src)) src:throw_impact(get_turf(src),speed)
if(isobj(src)) src.throw_impact(get_turf(src),speed)
//Overlays

View File

@@ -86,7 +86,7 @@
src << "<span class='warning'>This creature's DNA is ruined beyond useability!</span>"
return
if(!G.killing)
if(!G.state == GRAB_KILL)
src << "<span class='warning'>We must have a tighter grip to absorb this creature.</span>"
return
@@ -368,27 +368,26 @@
spawn(rand(800,2000))
if(changeling_power(20,1,100,DEAD))
// charge the changeling chemical cost for stasis
changeling.chem_charges -= 20
if(C.stat == DEAD)
dead_mob_list -= C
living_mob_list += C
C.stat = CONSCIOUS
C.tod = null
C.setToxLoss(0)
C.setOxyLoss(0)
C.setCloneLoss(0)
C.SetParalysis(0)
C.SetStunned(0)
C.SetWeakened(0)
C.radiation = 0
C.heal_overall_damage(C.getBruteLoss(), C.getFireLoss())
C.reagents.clear_reagents()
// restore us to health
C.rejuvenate()
// remove our fake death flag
C.status_flags &= ~(FAKEDEATH)
// let us move again
C.update_canmove()
// re-add out changeling powers
C.make_changeling()
// sending display messages
C << "<span class='notice'>We have regenerated.</span>"
C.visible_message("<span class='warning'>[src] appears to wake from the dead, having healed all wounds.</span>")
C.status_flags &= ~(FAKEDEATH)
C.update_canmove()
C.make_changeling()
feedback_add_details("changeling_powers","FD")
return 1

View File

@@ -36,6 +36,8 @@ var/global/datum/controller/gameticker/ticker
var/triai = 0//Global holder for Triumvirate
var/initialtpass = 0 //holder for inital autotransfer vote timer
/datum/controller/gameticker/proc/pregame()
login_music = pick(\
'sound/music/space.ogg',\
@@ -56,6 +58,18 @@ var/global/datum/controller/gameticker/ticker
current_state = GAME_STATE_SETTING_UP
while (!setup())
/datum/controller/gameticker/proc/votetimer()
var/timerbuffer = 0
if (initialtpass == 0)
timerbuffer = config.vote_autotransfer_initial
else
timerbuffer = config.vote_autotransfer_interval
spawn(timerbuffer)
vote.autotransfer()
initialtpass = 1
votetimer()
/datum/controller/gameticker/proc/setup()
//Create and announce mode
if(master_mode=="secret")
@@ -112,6 +126,7 @@ var/global/datum/controller/gameticker/ticker
data_core.manifest()
current_state = GAME_STATE_PLAYING
//here to initialize the random events nicely at round start
setup_economy()
@@ -146,6 +161,7 @@ var/global/datum/controller/gameticker/ticker
spawn(3000)
statistic_cycle() // Polls population totals regularly and stores them in an SQL DB -- TLE
votetimer()
return 1
/datum/controller/gameticker

View File

@@ -1,291 +0,0 @@
//Upper left action buttons, displayed when you pick up an item that has this enabled.
#define ui_action_slot1 "1:6,14:26"
#define ui_action_slot2 "2:8,14:26"
#define ui_action_slot3 "3:10,14:26"
#define ui_action_slot4 "4:12,14:26"
#define ui_action_slot5 "5:14,14:26"
//Lower left, persistant menu
#define ui_inventory "1:6,1:5"
//Lower center, persistant menu
#define ui_sstore1 "3:10,1:5"
#define ui_id "4:12,1:5"
#define ui_belt "5:14,1:5"
#define ui_back "6:14,1:5"
#define ui_rhand "7:16,1:5"
#define ui_lhand "8:16,1:5"
#define ui_equip "7:16,2:5"
#define ui_swaphand1 "7:16,2:5"
#define ui_swaphand2 "8:16,2:5"
#define ui_storage1 "9:18,1:5"
#define ui_storage2 "10:20,1:5"
#define ui_alien_head "4:12,1:5" //aliens
#define ui_alien_oclothing "5:14,1:5" //aliens
#define ui_inv1 "6:16,1:5" //borgs
#define ui_inv2 "7:16,1:5" //borgs
#define ui_inv3 "8:16,1:5" //borgs
#define ui_borg_store "9:16,1:5" //borgs
#define ui_monkey_mask "5:14,1:5" //monkey
#define ui_monkey_back "6:14,1:5" //monkey
//Lower right, persistant menu
#define ui_dropbutton "11:22,1:5"
#define ui_drop_throw "14:28,2:7"
#define ui_pull_resist "13:26,2:7"
#define ui_acti "13:26,1:5"
#define ui_movi "12:24,1:5"
#define ui_zonesel "14:28,1:5"
#define ui_acti_alt "14:28,1:5" //alternative intent switcher for when the interface is hidden (F12)
#define ui_borg_pull "12:24,2:7"
#define ui_borg_module "13:26,2:7"
#define ui_borg_panel "14:28,2:7"
//Gun buttons
#define ui_gun1 "13:26,3:7"
#define ui_gun2 "14:28, 4:7"
#define ui_gun3 "13:26,4:7"
#define ui_gun_select "14:28,3:7"
//Upper-middle right (damage indicators)
#define ui_toxin "14:28,13:27"
#define ui_fire "14:28,12:25"
#define ui_oxygen "14:28,11:23"
#define ui_pressure "14:28,10:21"
#define ui_alien_toxin "14:28,13:25"
#define ui_alien_fire "14:28,12:25"
#define ui_alien_oxygen "14:28,11:25"
//Middle right (status indicators)
#define ui_nutrition "14:28,5:11"
#define ui_temp "14:28,6:13"
#define ui_health "14:28,7:15"
#define ui_internal "14:28,8:17"
//borgs
#define ui_borg_health "14:28,6:13" //borgs have the health display where humans have the pressure damage indicator.
#define ui_alien_health "14:28,6:13" //aliens have the health display where humans have the pressure damage indicator.
//Pop-up inventory
#define ui_shoes "2:8,1:5"
#define ui_iclothing "1:6,2:7"
#define ui_oclothing "2:8,2:7"
#define ui_gloves "3:10,2:7"
#define ui_glasses "1:6,3:9"
#define ui_mask "2:8,3:9"
#define ui_l_ear "3:10,3:9"
#define ui_r_ear "3:10,4:11"
#define ui_head "2:8,4:11"
//Intent small buttons
#define ui_help_small "12:8,1:1"
#define ui_disarm_small "12:15,1:18"
#define ui_grab_small "12:32,1:18"
#define ui_harm_small "12:39,1:1"
//#define ui_swapbutton "6:-16,1:5" //Unused
//#define ui_headset "SOUTH,8"
#define ui_hand "6:14,1:5"
#define ui_hstore1 "5,5"
//#define ui_resist "EAST+1,SOUTH-1"
#define ui_sleep "EAST+1, NORTH-13"
#define ui_rest "EAST+1, NORTH-14"
#define ui_iarrowleft "SOUTH-1,11"
#define ui_iarrowright "SOUTH-1,13"
var/datum/global_hud/global_hud = new()
/datum/global_hud
var/obj/screen/druggy
var/obj/screen/blurry
var/list/vimpaired
var/list/darkMask
New()
//420erryday psychedellic colours screen overlay for when you are high
druggy = new /obj/screen()
druggy.screen_loc = "WEST,SOUTH to EAST,NORTH"
druggy.icon_state = "druggy"
druggy.layer = 17
druggy.mouse_opacity = 0
//that white blurry effect you get when you eyes are damaged
blurry = new /obj/screen()
blurry.screen_loc = "WEST,SOUTH to EAST,NORTH"
blurry.icon_state = "blurry"
blurry.layer = 17
blurry.mouse_opacity = 0
var/obj/screen/O
var/i
//that nasty looking dither you get when you're short-sighted
vimpaired = newlist(/obj/screen,/obj/screen,/obj/screen,/obj/screen)
O = vimpaired[1]
O.screen_loc = "1,1 to 5,15"
O = vimpaired[2]
O.screen_loc = "5,1 to 10,5"
O = vimpaired[3]
O.screen_loc = "6,11 to 10,15"
O = vimpaired[4]
O.screen_loc = "11,1 to 15,15"
//welding mask overlay black/dither
darkMask = newlist(/obj/screen,/obj/screen,/obj/screen,/obj/screen,/obj/screen,/obj/screen,/obj/screen,/obj/screen)
O = darkMask[1]
O.screen_loc = "3,3 to 5,13"
O = darkMask[2]
O.screen_loc = "5,3 to 10,5"
O = darkMask[3]
O.screen_loc = "6,11 to 10,13"
O = darkMask[4]
O.screen_loc = "11,3 to 13,13"
O = darkMask[5]
O.screen_loc = "1,1 to 15,2"
O = darkMask[6]
O.screen_loc = "1,3 to 2,15"
O = darkMask[7]
O.screen_loc = "14,3 to 15,15"
O = darkMask[8]
O.screen_loc = "3,14 to 13,15"
for(i=1,i<=4,i++)
O = vimpaired[i]
O.icon_state = "dither50"
O.layer = 17
O.mouse_opacity = 0
O = darkMask[i]
O.icon_state = "dither50"
O.layer = 17
O.mouse_opacity = 0
for(i=5,i<=8,i++)
O = darkMask[i]
O.icon_state = "black"
O.layer = 17
O.mouse_opacity = 0
/datum/hud/var/obj/screen/grab_intent
/datum/hud/var/obj/screen/hurt_intent
/datum/hud/var/obj/screen/disarm_intent
/datum/hud/var/obj/screen/help_intent
/datum/hud
var/mob/mymob
var/hud_shown = 1 //Used for the HUD toggle (F12)
var/inventory_shown = 1 //the inventory
var/show_intent_icons = 0
var/hotkey_ui_hidden = 0 //This is to hide the buttons that can be used via hotkeys. (hotkeybuttons list of buttons)
var/obj/screen/r_hand_hud_object
var/obj/screen/l_hand_hud_object
var/obj/screen/action_intent
var/obj/screen/move_intent
var/list/adding
var/list/other
var/list/obj/screen/hotkeybuttons
var/list/obj/screen/item_action/item_action_list //Used for the item action ui buttons.
datum/hud/New(mob/owner)
mymob = owner
instantiate()
..()
return
/datum/hud/proc/hidden_inventory_update()
if(!mymob) return
if(ishuman(mymob))
var/mob/living/carbon/human/H = mymob
if(inventory_shown && hud_shown)
if(H.shoes) H.shoes.screen_loc = ui_shoes
if(H.gloves) H.gloves.screen_loc = ui_gloves
if(H.l_ear) H.l_ear.screen_loc = ui_l_ear
if(H.r_ear) H.r_ear.screen_loc = ui_r_ear
if(H.glasses) H.glasses.screen_loc = ui_glasses
if(H.w_uniform) H.w_uniform.screen_loc = ui_iclothing
if(H.wear_suit) H.wear_suit.screen_loc = ui_oclothing
if(H.wear_mask) H.wear_mask.screen_loc = ui_mask
if(H.head) H.head.screen_loc = ui_head
else
if(H.shoes) H.shoes.screen_loc = null
if(H.gloves) H.gloves.screen_loc = null
if(H.l_ear) H.l_ear.screen_loc = null
if(H.r_ear) H.r_ear.screen_loc = null
if(H.glasses) H.glasses.screen_loc = null
if(H.w_uniform) H.w_uniform.screen_loc = null
if(H.wear_suit) H.wear_suit.screen_loc = null
if(H.wear_mask) H.wear_mask.screen_loc = null
if(H.head) H.head.screen_loc = null
/datum/hud/proc/persistant_inventory_update()
if(!mymob) return
if(ishuman(mymob))
var/mob/living/carbon/human/H = mymob
if(hud_shown)
if(H.s_store) H.s_store.screen_loc = ui_sstore1
if(H.wear_id) H.wear_id.screen_loc = ui_id
if(H.belt) H.belt.screen_loc = ui_belt
if(H.back) H.back.screen_loc = ui_back
if(H.l_store) H.l_store.screen_loc = ui_storage1
if(H.r_store) H.r_store.screen_loc = ui_storage2
else
if(H.s_store) H.s_store.screen_loc = null
if(H.wear_id) H.wear_id.screen_loc = null
if(H.belt) H.belt.screen_loc = null
if(H.back) H.back.screen_loc = null
if(H.l_store) H.l_store.screen_loc = null
if(H.r_store) H.r_store.screen_loc = null
/datum/hud/proc/instantiate()
if(!ismob(mymob)) return 0
if(!mymob.client) return 0
var/ui_style = ui_style2icon(mymob.client.prefs.UI_style)
if(ishuman(mymob))
human_hud(ui_style) // Pass the player the UI style chosen in preferences
else if(ismonkey(mymob))
monkey_hud(ui_style)
else if(isbrain(mymob))
brain_hud(ui_style)
else if(islarva(mymob))
larva_hud()
else if(isalien(mymob))
alien_hud()
else if(isAI(mymob))
ai_hud()
else if(isrobot(mymob))
robot_hud()
// else if(ishivebot(mymob))
// hivebot_hud()
// else if(ishivemainframe(mymob))
// hive_mainframe_hud()
else if(isobserver(mymob))
ghost_hud()
return

View File

@@ -45,11 +45,6 @@
if(prob(75))
del(src)
/obj/machinery/optable/hand_p(mob/user as mob)
return src.attack_paw(user)
return
/obj/machinery/optable/attack_paw(mob/user as mob)
if ((HULK in usr.mutations))
usr << text("\blue You destroy the operating table.")

View File

@@ -195,6 +195,7 @@
H.h_style = pick("Bedhead", "Bedhead 2", "Bedhead 3")
H.species = mrace
H.add_language(mrace.language)
H.update_mutantrace()
H.suiciding = 0
src.attempting = 0

View File

@@ -564,7 +564,7 @@
/obj/structure/holohoop/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if (istype(mover,/obj/item) && mover.throwing)
var/obj/item/I = mover
if(istype(I, /obj/item/weapon/dummy) || istype(I, /obj/item/projectile))
if(istype(I, /obj/item/projectile))
return
if(prob(50))
I.loc = src.loc

View File

@@ -179,15 +179,6 @@
A.transfer_ai("INACTIVE","AICARD",src,user)
return
attack_hand(var/mob/user as mob)
if(ishuman(user))//Checks to see if they are ninja
if(istype(user:gloves, /obj/item/clothing/gloves/space_ninja)&&user:gloves:candrain&&!user:gloves:draining)
if(user:wear_suit:s_control)
user:wear_suit:transfer_ai("INACTIVE","NINJASUIT",src,user)
else
user << "\red <b>ERROR</b>: \black Remote access channel disabled."
return
/*
This is a good place for AI-related object verbs so I'm sticking it here.
If adding stuff to this, don't forget that an AI need to cancel_camera() whenever it physically moves to a different location.

View File

@@ -60,14 +60,6 @@
if(..())
return
if(ishuman(user))//Checks to see if they are ninja
if(istype(user:gloves, /obj/item/clothing/gloves/space_ninja)&&user:gloves:candrain&&!user:gloves:draining)
if(user:wear_suit:s_control)
user:wear_suit.transfer_ai("AIFIXER","NINJASUIT",src,user)
else
user << "\red <b>ERROR</b>: \black Remote access channel disabled."
return
user.set_machine(src)
var/dat = "<h3>AI System Integrity Restorer</h3><br><br>"

View File

@@ -1,3 +1,8 @@
#define CHARS_PER_LINE 5
#define FONT_SIZE "5pt"
#define FONT_COLOR "#09f"
#define FONT_STYLE "Arial Black"
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
///////////////////////////////////////////////////////////////////////////////////////////////
@@ -23,6 +28,8 @@
var/list/obj/machinery/targets = list()
var/timetoset = 0 // Used to set releasetime upon starting the timer
maptext_height = 26
maptext_width = 32
/obj/machinery/door_timer/New()
..()
@@ -271,13 +278,14 @@
set_picture("ai_bsod")
return
if(src.timing)
var/disp1 = uppertext(id)
var/disp1 = id
var/timeleft = timeleft()
var/disp2 = "[add_zero(num2text((timeleft / 60) % 60),2)]~[add_zero(num2text(timeleft % 60), 2)]"
spawn( 5 )
update_display(disp1, disp2)
if(length(disp2) > CHARS_PER_LINE)
disp2 = "Error"
update_display(disp1, disp2)
else
update_display("SET","TIME")
if(maptext) maptext = ""
return
@@ -291,16 +299,9 @@
//Checks to see if there's 1 line or 2, adds text-icons-numbers/letters over display
// Stolen from status_display
/obj/machinery/door_timer/proc/update_display(var/line1, var/line2)
if(line2 == null) // single line display
overlays.Cut()
overlays += texticon(line1, 23, -13)
else // dual line display
overlays.Cut()
overlays += texticon(line1, 23, -9)
overlays += texticon(line2, 23, -17)
// return an icon of a time text string (tn)
// valid characters are 0-9 and :
// px, py are pixel offsets
var/new_text = {"<div style="font-size:[FONT_SIZE];color:[FONT_COLOR];font:'[FONT_STYLE]';text-align:center;" valign="top">[line1]<br>[line2]</div>"}
if(maptext != new_text)
maptext = new_text
//Actual string input to icon display for loop, with 5 pixel x offsets for each letter.
@@ -360,3 +361,8 @@
id = "Cell 6"
dir = 4
pixel_x = 32
#undef FONT_SIZE
#undef FONT_COLOR
#undef FONT_STYLE
#undef CHARS_PER_LINE

View File

@@ -120,12 +120,18 @@
/obj/machinery/door/attack_hand(mob/user as mob)
return src.attackby(user, user)
/obj/machinery/door/attack_tk(mob/user as mob)
if(requiresID() && !allowed(null))
return
..()
/obj/machinery/door/attackby(obj/item/I as obj, mob/user as mob)
if(istype(I, /obj/item/device/detective_scanner))
return
if(src.operating || isrobot(user)) return //borgs can't attack doors open because it conflicts with their AI-like interaction with them.
src.add_fingerprint(user)
if(!Adjacent(user))
user = null
if(!src.requiresID())
user = null
if(src.density && (istype(I, /obj/item/weapon/card/emag)||istype(I, /obj/item/weapon/melee/energy/blade)))

View File

@@ -15,116 +15,147 @@
var/list/areas_added
var/list/users_to_open
New()
. = ..()
for(var/obj/machinery/door/firedoor/F in loc)
if(F != src)
spawn(1)
del src
return .
var/area/A = get_area(src)
ASSERT(istype(A))
/obj/machinery/door/firedoor/New()
. = ..()
for(var/obj/machinery/door/firedoor/F in loc)
if(F != src)
spawn(1)
del src
return .
var/area/A = get_area(src)
ASSERT(istype(A))
A.all_doors.Add(src)
areas_added = list(A)
A.all_doors.Add(src)
areas_added = list(A)
for(var/direction in cardinal)
A = get_area(get_step(src,direction))
if(istype(A) && !(A in areas_added))
A.all_doors.Add(src)
areas_added += A
for(var/direction in cardinal)
A = get_area(get_step(src,direction))
if(istype(A) && !(A in areas_added))
A.all_doors.Add(src)
areas_added += A
Del()
for(var/area/A in areas_added)
A.all_doors.Remove(src)
. = ..()
/obj/machinery/door/firedoor/Del()
for(var/area/A in areas_added)
A.all_doors.Remove(src)
. = ..()
examine()
set src in view()
. = ..()
if( islist(users_to_open) && users_to_open.len)
var/users_to_open_string = users_to_open[1]
if(users_to_open.len >= 2)
for(var/i = 2 to users_to_open.len)
users_to_open_string += ", [users_to_open[i]]"
usr << "These people have opened \the [src] during an alert: [users_to_open_string]."
/obj/machinery/door/firedoor/examine()
set src in view()
. = ..()
if( islist(users_to_open) && users_to_open.len)
var/users_to_open_string = users_to_open[1]
if(users_to_open.len >= 2)
for(var/i = 2 to users_to_open.len)
users_to_open_string += ", [users_to_open[i]]"
usr << "These people have opened \the [src] during an alert: [users_to_open_string]."
Bumped(atom/AM)
if(p_open || operating)
/obj/machinery/door/firedoor/Bumped(atom/AM)
if(p_open || operating)
return
if(!density)
return ..()
if(istype(AM, /obj/mecha))
var/obj/mecha/mecha = AM
if (mecha.occupant)
var/mob/M = mecha.occupant
if(world.time - M.last_bumped <= 10) return //Can bump-open one airlock per second. This is to prevent popup message spam.
M.last_bumped = world.time
attack_hand(M)
return 0
/obj/machinery/door/firedoor/power_change()
if(powered(ENVIRON))
stat &= ~NOPOWER
else
stat |= NOPOWER
return
/obj/machinery/door/firedoor/attack_hand(mob/user as mob)
add_fingerprint(user)
if(operating)
return//Already doing something.
if(blocked)
user << "<span class='warning'>\The [src] is welded solid!</span>"
return
if(!allowed(user))
user << "<span class='warning'>Access denied.</span>"
return
var/area/A = get_area(src)
ASSERT(istype(A))
if(A.master)
A = A.master
var/alarmed = A.air_doors_activated || A.fire
var/answer = alert(user, "Would you like to [density ? "open" : "close"] this [src.name]?[ alarmed && density ? "\nNote that by doing so, you acknowledge any damages from opening this\n[src.name] as being your own fault, and you will be held accountable under the law." : ""]",\
"\The [src]", "Yes, [density ? "open" : "close"]", "No")
if(answer == "No")
return
if(user.stat || !user.canmove || user.stunned || user.weakened || user.paralysis || get_dist(src, user) > 1)
user << "Sorry, you must remain able bodied and close to \the [src] in order to use it."
return
var/needs_to_close = 0
if(density)
if(alarmed)
needs_to_close = 1
spawn()
open()
else
spawn()
close()
if(needs_to_close)
spawn(50)
if(alarmed)
nextstate = CLOSED
/obj/machinery/door/firedoor/attackby(obj/item/weapon/C as obj, mob/user as mob)
add_fingerprint(user)
if(operating)
return//Already doing something.
if(istype(C, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/W = C
if(W.remove_fuel(0, user))
blocked = !blocked
user.visible_message("\red \The [user] [blocked ? "welds" : "unwelds"] \the [src] with \a [W].",\
"You [blocked ? "weld" : "unweld"] \the [src] with \the [W].",\
"You hear something being welded.")
update_icon()
return
if(!density)
return ..()
if(istype(AM, /obj/mecha))
var/obj/mecha/mecha = AM
if (mecha.occupant)
var/mob/M = mecha.occupant
if(world.time - M.last_bumped <= 10) return //Can bump-open one airlock per second. This is to prevent popup message spam.
M.last_bumped = world.time
attack_hand(M)
return 0
power_change()
if(powered(ENVIRON))
stat &= ~NOPOWER
else
stat |= NOPOWER
if(blocked)
user << "\red \The [src] is welded solid!"
return
attack_hand(mob/user as mob)
return attackby(null, user)
attackby(obj/item/weapon/C as obj, mob/user as mob)
add_fingerprint(user)
if( istype(C, /obj/item/weapon/crowbar) || ( istype(C,/obj/item/weapon/twohanded/fireaxe) && C:wielded == 1 ) )
if(operating)
return//Already doing something.
if(istype(C, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/W = C
if(W.remove_fuel(0, user))
blocked = !blocked
user.visible_message("\red \The [user] [blocked ? "welds" : "unwelds"] \the [src] with \a [W].",\
"You [blocked ? "weld" : "unweld"] \the [src] with \the [W].",\
"You hear something being welded.")
update_icon()
return
if(blocked)
user << "\red \The [src] is welded solid!"
return
var/area/A = get_area(src)
ASSERT(istype(A))
if(A.master)
A = A.master
var/alarmed = A.air_doors_activated || A.fire
if( blocked && istype(C, /obj/item/weapon/crowbar) )
user.visible_message("\red \The [user] pries at \the [src] with \a [C], but \the [src] is welded in place!",\
"You try to pry \the [src] [density ? "open" : "closed"], but it is welded in place!",\
"You hear someone struggle and metal straining.")
return
if( istype(C, /obj/item/weapon/crowbar) || ( istype(C,/obj/item/weapon/twohanded/fireaxe) && C:wielded == 1 ) )
if(operating)
return
if( blocked && istype(C, /obj/item/weapon/crowbar) )
user.visible_message("\red \The [user] pries at \the [src] with \a [C], but \the [src] is welded in place!",\
"You try to pry \the [src] [density ? "open" : "closed"], but it is welded in place!",\
"You hear someone struggle and metal straining.")
return
user.visible_message("\red \The [user] starts to force \the [src] [density ? "open" : "closed"] with \a [C]!",\
"You start forcing \the [src] [density ? "open" : "closed"] with \the [C]!",\
"You hear metal strain.")
if(do_after(user,30))
if( istype(C, /obj/item/weapon/crowbar) )
if( stat & (BROKEN|NOPOWER) || !density || !alarmed )
if( stat & (BROKEN|NOPOWER) || !density)
user.visible_message("\red \The [user] forces \the [src] [density ? "open" : "closed"] with \a [C]!",\
"You force \the [src] [density ? "open" : "closed"] with \the [C]!",\
"You hear metal strain, and a door [density ? "open" : "close"].")
else if( allowed(user) )
user.visible_message("\blue \The [user] lifts \the [src] with \a [C].",\
"\The [src] scans your ID, and obediently opens as you apply your [C].",\
"You hear metal move, and a door [density ? "open" : "close"].")
else
user.visible_message("\blue \The [user] pries at \the [src] with \a [C], but \the [src] resists being opened.",\
"\red You pry at \the [src], but it actively resists your efforts. Maybe use your ID, perhaps?",\
"You hear someone struggling and metal straining")
return
else
user.visible_message("\red \The [user] forces \the [ blocked ? "welded" : "" ] [src] [density ? "open" : "closed"] with \a [C]!",\
"You force \the [ blocked ? "welded" : "" ] [src] [density ? "open" : "closed"] with \the [C]!",\
@@ -136,101 +167,50 @@
spawn(0)
close()
return
var/access_granted = 0
var/users_name
if(!istype(C, /obj)) //If someone hit it with their hand. We need to see if they are allowed.
if(allowed(user))
access_granted = 1
if(ishuman(user))
users_name = FindNameFromID(user)
else
users_name = "Unknown"
if( ishuman(user) && !stat && ( istype(C, /obj/item/weapon/card/id) || istype(C, /obj/item/device/pda) ) )
var/obj/item/weapon/card/id/ID = C
if( istype(C, /obj/item/device/pda) )
var/obj/item/device/pda/pda = C
ID = pda.id
if(!istype(ID))
ID = null
if(ID)
users_name = ID.registered_name
if(check_access(ID))
access_granted = 1
var/answer = alert(user, "Would you like to [density ? "open" : "close"] this [src.name]?[ alarmed && density && !access_granted ? "\nNote that by doing so, you acknowledge any damages from opening this\n[src.name] as being your own fault, and you will be held accountable under the law." : ""]",\
"\The [src]", "Yes, [density ? "open" : "close"]", "No")
if(answer == "No")
return
if(user.stat || !user.canmove || user.stunned || user.weakened || user.paralysis || get_dist(src, user) > 1)
user << "Sorry, you must remain able bodied and close to \the [src] in order to use it."
return
if(alarmed && density && !access_granted && !( users_name in users_to_open ) )
user.visible_message("\red \The [src] opens for \the [user], but only after they acknowledged responsibility for the consequences.",\
"\The [src] opens after you acknowledge the consequences.",\
"You hear a beep, and a door opening.")
if(!users_to_open)
users_to_open = list()
users_to_open += users_name
else
user.visible_message("\blue \The [src] [density ? "open" : "close"]s for \the [user].",\
"\The [src] [density ? "open" : "close"]s.",\
"You hear a beep, and a door opening.")
var/needs_to_close = 0
if(density)
if(alarmed)
needs_to_close = 1
spawn()
open()
else
spawn()
close()
if(needs_to_close)
spawn(50)
if(alarmed)
nextstate = CLOSED
process()
if(operating || stat & NOPOWER || !nextstate)
return
switch(nextstate)
if(OPEN)
spawn()
open()
if(CLOSED)
spawn()
close()
nextstate = null
/obj/machinery/door/firedoor/proc/latetoggle()
if(operating || stat & NOPOWER || !nextstate)
return
switch(nextstate)
if(OPEN)
nextstate = null
open()
if(CLOSED)
nextstate = null
close()
return
/obj/machinery/door/firedoor/close()
latetoggle()
return ..()
/obj/machinery/door/firedoor/open()
latetoggle()
return ..()
do_animate(animation)
switch(animation)
if("opening")
flick("door_opening", src)
if("closing")
flick("door_closing", src)
return
/obj/machinery/door/firedoor/do_animate(animation)
switch(animation)
if("opening")
flick("door_opening", src)
if("closing")
flick("door_closing", src)
return
update_icon()
overlays.Cut()
if(density)
icon_state = "door_closed"
if(blocked)
overlays += "welded"
else
icon_state = "door_open"
if(blocked)
overlays += "welded_open"
return
/obj/machinery/door/firedoor/update_icon()
overlays.Cut()
if(density)
icon_state = "door_closed"
if(blocked)
overlays += "welded"
else
icon_state = "door_open"
if(blocked)
overlays += "welded_open"
return
@@ -276,4 +256,4 @@
/obj/machinery/door/firedoor/multi_tile
icon = 'icons/obj/doors/DoorHazard2x1.dmi'
width = 2
width = 2

View File

@@ -110,7 +110,6 @@
else
return ..()
/obj/machinery/pipedispenser/disposal
name = "Disposal Pipe Dispenser"
icon = 'icons/obj/stationobjs.dmi'
@@ -200,3 +199,11 @@ Nah
wait = 0
return
// adding a pipe dispensers that spawn unhooked from the ground
/obj/machinery/pipedispenser/orderable
anchored = 0
unwrenched = 1
/obj/machinery/pipedispenser/disposal/orderable
anchored = 0
unwrenched = 1

View File

@@ -1,3 +1,9 @@
#define CHARS_PER_LINE 5
#define FONT_SIZE "5pt"
#define FONT_COLOR "#09f"
#define FONT_STYLE "Arial Black"
#define SCROLL_SPEED 2
// Status display
// (formerly Countdown timer display)
@@ -25,15 +31,14 @@
var/index1 // display index for scrolling messages or 0 if non-scrolling
var/index2
var/lastdisplayline1 = "" // the cached last displays
var/lastdisplayline2 = ""
var/frequency = 1435 // radio frequency
var/supply_display = 0 // true if a supply shuttle display
var/repeat_update = 0 // true if we are going to update again this ptick
var/friendc = 0 // track if Friend Computer mode
maptext_height = 26
maptext_width = 32
// new display
// register for radio system
New()
@@ -47,9 +52,8 @@
process()
if(stat & NOPOWER)
overlays.Cut()
remove_display()
return
update()
emp_act(severity)
@@ -62,173 +66,114 @@
// set what is displayed
proc/update()
if(friendc && mode!=4) //Makes all status displays except supply shuttle timer display the eye -- Urist
set_picture("ai_friend")
return
if(mode==0)
overlays.Cut()
return
if(mode==3) // alert picture, no change
return
if(mode==1) // shuttle timer
if(emergency_shuttle.online)
var/displayloc
if(emergency_shuttle.location == 1)
displayloc = "ETD "
switch(mode)
if(0) //blank
remove_display()
if(1) //emergency shuttle timer
if(emergency_shuttle.online)
var/line1
var/line2 = get_shuttle_timer()
if(emergency_shuttle.location == 1)
line1 = "-ETD-"
else
line1 = "-ETA-"
if(length(line2) > CHARS_PER_LINE)
line2 = "Error!"
update_display(line1, line2)
else
displayloc = "ETA "
remove_display()
if(2) //custom messages
var/line1
var/line2
var/displaytime = get_shuttle_timer()
if(lentext(displaytime) > 5)
displaytime = "**~**"
update_display(displayloc, displaytime)
return
else
overlays.Cut()
return
if(mode==4) // supply shuttle timer
var/disp1
var/disp2
if(supply_shuttle.moving)
disp1 = "SPPLY"
disp2 = get_supply_shuttle_timer()
if(lentext(disp1) > 5)
disp1 = "**~**"
else
if(supply_shuttle.at_station)
disp1 = "SPPLY"
disp2 = "STATN"
if(!index1)
line1 = message1
else
disp1 = "SPPLY"
disp2 = "AWAY"
line1 = copytext(message1+"|"+message1, index1, index1+CHARS_PER_LINE)
var/message1_len = length(message1)
index1 += SCROLL_SPEED
if(index1 > message1_len)
index1 -= message1_len
update_display(disp1, disp2)
if(!index2)
line2 = message2
else
line2 = copytext(message2+"|"+message2, index2, index2+CHARS_PER_LINE)
var/message2_len = length(message2)
index2 += SCROLL_SPEED
if(index2 > message2_len)
index2 -= message2_len
update_display(line1, line2)
if(4) // supply shuttle timer
var/line1 = "SUPPLY"
var/line2
if(supply_shuttle.moving)
line2 = get_supply_shuttle_timer()
if(lentext(line2) > CHARS_PER_LINE)
line2 = "Error"
else
if(supply_shuttle.at_station)
line2 = "Docked"
else
line1 = ""
update_display(line1, line2)
examine()
set src in view()
. = ..()
switch(mode)
if(1,2,4)
usr << "The display says:<br>\t<xmp>[message1]</xmp><br>\t<xmp>[message2]</xmp>"
if(mode==2)
var/line1
var/line2
if(!index1)
line1 = message1
else
line1 = copytext(message1+message1, index1, index1+5)
if(index1++ > (lentext(message1)))
index1 = 1
if(!index2)
line2 = message2
else
line2 = copytext(message2+message2, index2, index2+5)
if(index2++ > (lentext(message2)))
index2 = 1
update_display(line1, line2)
// the following allows 2 updates per process, giving faster scrolling
if((index1 || index2) && repeat_update) // if either line is scrolling
// and we haven't forced an update yet
spawn(5)
repeat_update = 0
update() // set to update again in 5 ticks
repeat_update = 1
proc/set_message(var/m1, var/m2)
proc/set_message(m1, m2)
if(m1)
index1 = (lentext(m1) > 5)
message1 = uppertext(m1)
index1 = (length(m1) > CHARS_PER_LINE)
message1 = m1
else
message1 = ""
index1 = 0
if(m2)
index2 = (lentext(m2) > 5)
message2 = uppertext(m2)
index2 = (length(m2) > CHARS_PER_LINE)
message2 = m2
else
message2 = null
message2 = ""
index2 = 0
repeat_update = 1
proc/set_picture(var/state)
proc/set_picture(state)
picture_state = state
overlays.Cut()
remove_display()
overlays += image('icons/obj/status_display.dmi', icon_state=picture_state)
proc/update_display(var/line1, var/line2)
if(line1 == lastdisplayline1 && line2 == lastdisplayline2)
return // no change, no need to update
lastdisplayline1 = line1
lastdisplayline2 = line2
if(line2 == null) // single line display
overlays.Cut()
overlays += texticon(line1, 23, -13)
else // dual line display
overlays.Cut()
overlays += texticon(line1, 23, -9)
overlays += texticon(line2, 23, -17)
// return shuttle timer as text
proc/update_display(line1, line2)
var/new_text = {"<div style="font-size:[FONT_SIZE];color:[FONT_COLOR];font:'[FONT_STYLE]';text-align:center;" valign="top">[line1]<br>[line2]</div>"}
if(maptext != new_text)
maptext = new_text
proc/get_shuttle_timer()
var/timeleft = emergency_shuttle.timeleft()
if(timeleft)
return "[add_zero(num2text((timeleft / 60) % 60),2)]~[add_zero(num2text(timeleft % 60), 2)]"
// note ~ translates into a blinking :
return "[add_zero(num2text((timeleft / 60) % 60),2)]:[add_zero(num2text(timeleft % 60), 2)]"
return ""
proc/get_supply_shuttle_timer()
if(supply_shuttle.moving)
var/timeleft = round((supply_shuttle.eta_timeofday - world.timeofday) / 10,1)
return "[add_zero(num2text((timeleft / 60) % 60),2)]~[add_zero(num2text(timeleft % 60), 2)]"
// note ~ translates into a blinking :
if(timeleft < 0)
return "Late"
return "[add_zero(num2text((timeleft / 60) % 60),2)]:[add_zero(num2text(timeleft % 60), 2)]"
return ""
// return an icon of a time text string (tn)
// valid characters are 0-9 and :
// px, py are pixel offsets
proc/texticon(var/tn, var/px = 0, var/py = 0)
var/image/I = image('icons/obj/status_display.dmi', "blank")
var/len = lentext(tn)
for(var/d = 1 to len)
var/char = copytext(tn, len-d+1, len-d+2)
if(char == " ")
continue
var/image/ID = image('icons/obj/status_display.dmi', icon_state=char)
ID.pixel_x = -(d-1)*5 + px
ID.pixel_y = py
I.overlays += ID
return I
proc/remove_display()
if(overlays.len)
overlays.Cut()
if(maptext)
maptext = ""
receive_signal(datum/signal/signal)
@@ -318,16 +263,6 @@
set_picture("ai_facepalm")
if("Friend Computer")
set_picture("ai_friend")
if("Tribunal")
set_picture("tribunal")
if("Beer mug")
set_picture("ai_beer")
if("Dwarf")
set_picture("ai_dwarf")
if("Fishtank")
set_picture("ai_fishtank")
if("Plump Helmet")
set_picture("ai_plump")
return
@@ -338,5 +273,12 @@
proc/set_picture(var/state)
picture_state = state
overlays.Cut()
if(overlays.len)
overlays.Cut()
overlays += image('icons/obj/status_display.dmi', icon_state=picture_state)
#undef CHARS_PER_LINE
#undef FOND_SIZE
#undef FONT_COLOR
#undef FONT_STYLE
#undef SCROLL_SPEED

View File

@@ -27,6 +27,9 @@
set category = "Object"
set src in oview(1)
if(!istype(usr, /mob/living)) //ew ew ew usr, but it's the only way to check.
return
if( state != 4 )
usr << "The washing machine cannot run in this state."
return

View File

@@ -22,7 +22,7 @@
weapons += new /datum/mecha_weapon/honker(src)
weapons += new /datum/mecha_weapon/missile_rack/banana_mortar(src)
weapons += new /datum/mecha_weapon/missile_rack/mousetrap_mortar(src)
weapons += new /datum/mecha_weapon/missile_rack/banana_mortar/mousetrap_mortar(src)
selected_weapon = weapons[1]
return
*/

View File

@@ -47,7 +47,7 @@
..()
var/obj/item/mecha_parts/mecha_equipment/ME = new /obj/item/mecha_parts/mecha_equipment/weapon/energy/pulse
ME.attach(src)
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/explosive
ME.attach(src)
ME = new /obj/item/mecha_parts/mecha_equipment/tesla_energy_relay(src)
ME.attach(src)
@@ -66,7 +66,7 @@
del(ME)
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/scattershot(src)
ME.attach(src)
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack(src)
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/explosive(src)
ME.attach(src)
ME = new /obj/item/mecha_parts/mecha_equipment/teleporter(src)
ME.attach(src)

View File

@@ -2,41 +2,68 @@
name = "mecha weapon"
range = RANGED
origin_tech = "materials=3;combat=3"
var/projectile
var/fire_sound
var/projectile //Type of projectile fired.
var/projectiles = 1 //Amount of projectiles loaded.
var/projectiles_per_shot = 1 //Amount of projectiles fired per single shot.
var/deviation = 0 //Inaccuracy of shots.
var/fire_cooldown = 0 //Duration of sleep between firing projectiles in single shot.
var/fire_sound //Sound played while firing.
var/fire_volume = 50 //How loud it is played.
var/auto_rearm = 0 //Does the weapon reload itself after each shot?
/obj/item/mecha_parts/mecha_equipment/weapon/can_attach(var/obj/mecha/combat/M as obj)
if(..())
if(istype(M))
return 1
return 0
if(!istype(M))
return 0
return ..()
/obj/item/mecha_parts/mecha_equipment/weapon/action_checks(atom/target)
if(projectiles <= 0)
return 0
return ..()
/obj/item/mecha_parts/mecha_equipment/weapon/action(atom/target)
if(!action_checks(target))
return
var/turf/curloc = chassis.loc
var/turf/targloc = get_turf(target)
if(!curloc || !targloc)
return
chassis.use_power(energy_drain)
chassis.visible_message("<span class='warning'>[chassis] fires [src]!</span>")
occupant_message("<span class='warning'>You fire [src]!</span>")
log_message("Fired from [src], targeting [target].")
for(var/i = 1 to min(projectiles, projectiles_per_shot))
var/turf/aimloc = targloc
if(deviation)
aimloc = locate(targloc.x+GaussRandRound(deviation,1),targloc.y+GaussRandRound(deviation,1),targloc.z)
if(!aimloc || aimloc == curloc)
break
playsound(chassis, fire_sound, fire_volume, 1)
projectiles--
var/P = new projectile(curloc)
Fire(P, target, aimloc)
if(fire_cooldown)
sleep(fire_cooldown)
if(auto_rearm)
projectiles = projectiles_per_shot
set_ready_state(0)
do_after_cooldown()
return
/obj/item/mecha_parts/mecha_equipment/weapon/proc/Fire(atom/A, atom/target, turf/aimloc)
var/obj/item/projectile/P = A
P.shot_from = src
P.original = target
P.starting = P.loc
P.current = P.loc
P.firer = chassis.occupant
P.yo = aimloc.y - P.loc.y
P.xo = aimloc.x - P.loc.x
P.process()
/obj/item/mecha_parts/mecha_equipment/weapon/energy
name = "General Energy Weapon"
action(target)
if(!action_checks(target)) return
var/turf/curloc = chassis.loc
var/atom/targloc = get_turf(target)
if (!targloc || !istype(targloc, /turf) || !curloc)
return
if (targloc == curloc)
return
set_ready_state(0)
playsound(chassis, fire_sound, 50, 1)
var/obj/item/projectile/A = new projectile(curloc)
A.original = target
A.current = curloc
A.yo = targloc.y - curloc.y
A.xo = targloc.x - curloc.x
chassis.use_power(energy_drain)
A.process()
chassis.log_message("Fired from [src.name], targeting [target].")
do_after_cooldown()
return
auto_rearm = 1
/obj/item/mecha_parts/mecha_equipment/weapon/energy/laser
equip_cooldown = 8
@@ -104,10 +131,9 @@
construction_cost = list("metal"=20000,"bananium"=10000)
can_attach(obj/mecha/combat/honker/M as obj)
if(..())
if(istype(M))
return 1
return 0
if(!istype(M))
return 0
return ..()
action(target)
if(!chassis)
@@ -152,15 +178,8 @@
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic
name = "General Ballisic Weapon"
var/projectiles
var/projectile_energy_cost
action_checks(atom/target)
if(..())
if(projectiles > 0)
return 1
return 0
get_equip_info()
return "[..()]\[[src.projectiles]\][(src.projectiles < initial(src.projectiles))?" - <a href='?src=\ref[src];rearm=1'>Rearm</a>":null]"
@@ -188,38 +207,11 @@
equip_cooldown = 20
projectile = /obj/item/projectile/bullet/midbullet
fire_sound = 'sound/weapons/Gunshot.ogg'
fire_volume = 80
projectiles = 40
projectiles_per_shot = 4
deviation = 0.7
projectile_energy_cost = 25
var/projectiles_per_shot = 4
var/deviation = 0.7
action(atom/target)
if(!action_checks(target)) return
var/turf/curloc = get_turf(chassis)
var/turf/targloc = get_turf(target)
if(!curloc || !targloc) return
var/target_x = targloc.x
var/target_y = targloc.y
var/target_z = targloc.z
targloc = null
for(var/i=1 to min(projectiles, projectiles_per_shot))
targloc = locate(target_x+GaussRandRound(deviation,1),target_y+GaussRandRound(deviation,1),target_z)
if(!targloc || targloc == curloc)
break
playsound(chassis, fire_sound, 80, 1)
var/obj/item/projectile/A = new projectile(curloc)
src.projectiles--
A.original = target
A.current = curloc
A.yo = targloc.y - curloc.y
A.xo = targloc.x - curloc.x
set_ready_state(0)
A.process()
log_message("Fired from [src.name], targeting [target].")
do_after_cooldown()
return
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/lmg
name = "Ultra AC 2"
@@ -228,41 +220,19 @@
projectile = /obj/item/projectile/bullet/weakbullet
fire_sound = 'sound/weapons/Gunshot.ogg'
projectiles = 300
projectiles_per_shot = 3
deviation = 0.3
projectile_energy_cost = 20
var/projectiles_per_shot = 3
var/deviation = 0.3
action(atom/target)
if(!action_checks(target)) return
var/turf/targloc = get_turf(target)
var/target_x = targloc.x
var/target_y = targloc.y
var/target_z = targloc.z
targloc = null
spawn for(var/i=1 to min(projectiles, projectiles_per_shot))
if(!chassis) break
var/turf/curloc = get_turf(chassis)
targloc = locate(target_x+GaussRandRound(deviation,1),target_y+GaussRandRound(deviation,1),target_z)
if (!targloc || !curloc)
continue
if (targloc == curloc)
continue
playsound(chassis, fire_sound, 50, 1)
var/obj/item/projectile/A = new projectile(curloc)
src.projectiles--
A.original = target
A.current = curloc
A.yo = targloc.y - curloc.y
A.xo = targloc.x - curloc.x
A.process()
sleep(2)
set_ready_state(0)
log_message("Fired from [src.name], targeting [target].")
do_after_cooldown()
return
fire_cooldown = 2
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack
var/missile_speed = 2
var/missile_range = 30
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/Fire(atom/movable/AM, atom/target, turf/aimloc)
AM.throw_at(target,missile_range, missile_speed)
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/explosive
name = "SRM-8 Missile Rack"
icon_state = "mecha_missilerack"
projectile = /obj/item/missile
@@ -270,21 +240,11 @@
projectiles = 8
projectile_energy_cost = 1000
equip_cooldown = 60
var/missile_speed = 2
var/missile_range = 30
action(target)
if(!action_checks(target)) return
set_ready_state(0)
var/obj/item/missile/M = new projectile(chassis.loc)
M.primed = 1
playsound(chassis, fire_sound, 50, 1)
M.throw_at(target, missile_range, missile_speed)
projectiles--
log_message("Fired from [src.name], targeting [target].")
do_after_cooldown()
return
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/explosive/Fire(atom/movable/AM, atom/target, turf/aimloc)
var/obj/item/missile/M = AM
M.primed = 1
..()
/obj/item/missile
icon = 'icons/obj/grenade.dmi'
@@ -311,18 +271,11 @@
equip_cooldown = 60
var/det_time = 20
action(target)
if(!action_checks(target)) return
set_ready_state(0)
var/obj/item/weapon/grenade/flashbang/F = new projectile(chassis.loc)
playsound(chassis, fire_sound, 50, 1)
F.throw_at(target, missile_range, missile_speed)
projectiles--
log_message("Fired from [src.name], targeting [target].")
spawn(det_time)
F.prime()
do_after_cooldown()
return
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/flashbang/Fire(atom/movable/AM, atom/target, turf/aimloc)
..()
var/obj/item/weapon/grenade/flashbang/F = AM
spawn(det_time)
F.prime()
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/flashbang/clusterbang//Because I am a heartless bastard -Sieve
name = "SOP-6 Grenade Launcher"
@@ -348,49 +301,17 @@
construction_cost = list("metal"=20000,"bananium"=5000)
can_attach(obj/mecha/combat/honker/M as obj)
if(..())
if(istype(M))
return 1
return 0
if(!istype(M))
return 0
return ..()
action(target)
if(!action_checks(target)) return
set_ready_state(0)
var/obj/item/weapon/bananapeel/B = new projectile(chassis.loc)
playsound(chassis, fire_sound, 60, 1)
B.throw_at(target, missile_range, missile_speed)
projectiles--
log_message("Bananed from [src.name], targeting [target]. HONK!")
do_after_cooldown()
return
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/mousetrap_mortar
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/banana_mortar/mousetrap_mortar
name = "Mousetrap Mortar"
icon_state = "mecha_mousetrapmrtr"
projectile = /obj/item/device/assembly/mousetrap
fire_sound = 'sound/items/bikehorn.ogg'
projectiles = 15
missile_speed = 1.5
projectile_energy_cost = 100
equip_cooldown = 10
construction_time = 300
construction_cost = list("metal"=20000,"bananium"=5000)
can_attach(obj/mecha/combat/honker/M as obj)
if(..())
if(istype(M))
return 1
return 0
action(target)
if(!action_checks(target)) return
set_ready_state(0)
var/obj/item/device/assembly/mousetrap/M = new projectile(chassis.loc)
M.secured = 1
playsound(chassis, fire_sound, 60, 1)
M.throw_at(target, missile_range, missile_speed)
projectiles--
log_message("Launched a mouse-trap from [src.name], targeting [target]. HONK!")
do_after_cooldown()
return
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/banana_mortar/mousetrap_mortar/Fire(atom/movable/AM, atom/target, turf/aimloc)
var/obj/item/device/assembly/mousetrap/M = AM
M.secured = 1
..()

View File

@@ -112,7 +112,7 @@
///obj/item/mecha_parts/mecha_equipment/jetpack, //TODO MECHA JETPACK SPRITE MISSING
/obj/item/mecha_parts/mecha_equipment/weapon/energy/taser,
/obj/item/mecha_parts/mecha_equipment/weapon/ballistic/lmg,
///obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/mousetrap_mortar, HONK-related mech part
///obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/banana_mortar/mousetrap_mortar, HONK-related mech part
///obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/banana_mortar, Also HONK-related
///obj/item/mecha_parts/mecha_equipment/weapon/honker Thirdly HONK-related
),

View File

@@ -418,11 +418,6 @@
/obj/mecha/attack_hand(mob/user as mob)
src.log_message("Attack by hand/paw. Attacker - [user].",1)
if(ishuman(user))
if(istype(user:gloves, /obj/item/clothing/gloves/space_ninja)&&user:gloves:candrain&&!user:gloves:draining)
call(/obj/item/clothing/gloves/space_ninja/proc/drain)("MECHA",src,user:wear_suit)
return
if ((HULK in user.mutations) && !prob(src.deflect_chance))
src.take_damage(15)
src.check_for_internal_damage(list(MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST))

View File

@@ -6,7 +6,7 @@
name = "mecha part"
icon = 'icons/mecha/mech_construct.dmi'
icon_state = "blank"
w_class = 20
w_class = 5
flags = FPRINT | TABLEPASS | CONDUCT
origin_tech = "programming=2;materials=2"
var/construction_time = 100

View File

@@ -1,6 +1,8 @@
/obj/mecha/medical/New()
..()
new /obj/item/mecha_parts/mecha_tracking(src)
var/turf/T = get_turf(src)
if(T.z != 2)
new /obj/item/mecha_parts/mecha_tracking(src)
return

View File

@@ -3,7 +3,9 @@
/obj/mecha/working/New()
..()
new /obj/item/mecha_parts/mecha_tracking(src)
var/turf/T = get_turf(src)
if(T.z != 2)
new /obj/item/mecha_parts/mecha_tracking(src)
return
/*

View File

@@ -16,6 +16,8 @@
var/spreadChance = 40
var/spreadIntoAdjacentChance = 60
var/evolveChance = 2
var/lastTick = 0
var/spreaded = 1
/obj/effect/glowshroom/single
spreadChance = 0
@@ -40,15 +42,21 @@
else //if on the floor, glowshroom on-floor sprite
icon_state = "glowshroomf"
spawn(delay)
SetLuminosity(round(potency/10))
Spread()
processing_objects += src
/obj/effect/glowshroom/proc/Spread()
set background = 1
var/spreaded = 1
SetLuminosity(round(potency/10))
lastTick = world.timeofday
while(spreaded)
/obj/effect/glowshroom/Del()
processing_objects -= src
..()
/obj/effect/glowshroom/process()
if(!spreaded)
return
if(((world.timeofday - lastTick) > delay) || ((world.timeofday - lastTick) < 0))
lastTick = world.timeofday
spreaded = 0
for(var/i=1,i<=yield,i++)
@@ -90,8 +98,6 @@
if(prob(evolveChance)) //very low chance to evolve on its own
potency += rand(4,6)
sleep(delay)
/obj/effect/glowshroom/proc/CalcDir(turf/location = loc)
set background = 1
var/direction = 16

View File

@@ -131,8 +131,7 @@
else
if(isliving(src.loc))
return
user.lastDblClick = world.time + 2
user.next_move = world.time + 2
user.next_move = max(user.next_move+2,world.time + 2)
src.pickup(user)
add_fingerprint(user)
user.put_in_active_hand(src)
@@ -166,8 +165,7 @@
if(istype(src.loc, /mob/living))
return
src.pickup(user)
user.lastDblClick = world.time + 2
user.next_move = world.time + 2
user.next_move = max(user.next_move+2,world.time + 2)
user.put_in_active_hand(src)
return
@@ -205,156 +203,6 @@
return
/obj/item/proc/attack(mob/living/M as mob, mob/living/user as mob, def_zone)
if (!istype(M)) // not sure if this is the right thing...
return
if (can_operate(M)) //Checks if mob is lying down on table for surgery
if (do_surgery(M,user,src))
return
var/messagesource = M
if (istype(M,/mob/living/carbon/brain))
messagesource = M:container
if (src.hitsound)
playsound(src.loc, hitsound, 50, 1, -1)
/////////////////////////
user.lastattacked = M
M.lastattacker = user
M.attack_log += "\[[time_stamp()]\]<font color='orange'> Attacked by [user.name] ([user.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(src.damtype)])</font>"
user.attack_log += "\[[time_stamp()]\]<font color='red'> Attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(src.damtype)])</font>"
msg_admin_attack("[user.name] ([user.ckey]) attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(src.damtype)]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)") //BS12 EDIT ALG
//spawn(1800) // this wont work right
// M.lastattacker = null
/////////////////////////
var/power = src.force
if(HULK in user.mutations)
power *= 2
if(!istype(M, /mob/living/carbon/human))
if(istype(M, /mob/living/carbon/slime))
var/mob/living/carbon/slime/slime = M
if(prob(25))
user << "\red [src] passes right through [M]!"
return
if(power > 0)
slime.attacked += 10
if(slime.Discipline && prob(50)) // wow, buddy, why am I getting attacked??
slime.Discipline = 0
if(power >= 3)
if(istype(slime, /mob/living/carbon/slime/adult))
if(prob(5 + round(power/2)))
if(slime.Victim)
if(prob(80) && !slime.client)
slime.Discipline++
slime.Victim = null
slime.anchored = 0
spawn()
if(slime)
slime.SStun = 1
sleep(rand(5,20))
if(slime)
slime.SStun = 0
spawn(0)
if(slime)
slime.canmove = 0
step_away(slime, user)
if(prob(25 + power))
sleep(2)
if(slime && user)
step_away(slime, user)
slime.canmove = 1
else
if(prob(10 + power*2))
if(slime)
if(slime.Victim)
if(prob(80) && !slime.client)
slime.Discipline++
if(slime.Discipline == 1)
slime.attacked = 0
spawn()
if(slime)
slime.SStun = 1
sleep(rand(5,20))
if(slime)
slime.SStun = 0
slime.Victim = null
slime.anchored = 0
spawn(0)
if(slime && user)
step_away(slime, user)
slime.canmove = 0
if(prob(25 + power*4))
sleep(2)
if(slime && user)
step_away(slime, user)
slime.canmove = 1
var/showname = "."
if(user)
showname = " by [user]."
if(!(user in viewers(M, null)))
showname = "."
for(var/mob/O in viewers(messagesource, null))
if(src.attack_verb.len)
O.show_message("\red <B>[M] has been [pick(src.attack_verb)] with [src][showname] </B>", 1)
else
O.show_message("\red <B>[M] has been attacked with [src][showname] </B>", 1)
if(!showname && user)
if(user.client)
user << "\red <B>You attack [M] with [src]. </B>"
if(istype(M, /mob/living/carbon/human))
M:attacked_by(src, user, def_zone)
else
switch(src.damtype)
if("brute")
if(istype(src, /mob/living/carbon/slime))
M.adjustBrainLoss(power)
else
M.take_organ_damage(power)
if (prob(33)) // Added blood for whacking non-humans too
var/turf/simulated/location = M.loc
if (istype(location))
location.add_blood_floor(M)
if("fire")
if (!(COLD_RESISTANCE in M.mutations))
M.take_organ_damage(0, power)
M << "Aargh it burns!"
M.updatehealth()
src.add_fingerprint(user)
return 1
/obj/item/proc/attack_self()
return
/obj/item/proc/afterattack()
return
/obj/item/proc/talk_into(mob/M as mob, text)
return
@@ -590,6 +438,8 @@
if(!(usr)) //BS12 EDIT
return
if(!usr.canmove || usr.stat || usr.restrained() || !Adjacent(usr))
return
if((!istype(usr, /mob/living/carbon)) || (istype(usr, /mob/living/carbon/brain)))//Is humanoid, and is not a brain
usr << "\red You can't pick things up!"
return
@@ -609,12 +459,7 @@
usr << "\red You can't pick that up!"
return
//All checks are done, time to pick it up!
if(istype(usr, /mob/living/carbon/human))
src.attack_hand(usr)
if(istype(usr, /mob/living/carbon/alien))
src.attack_alien(usr)
if(istype(usr, /mob/living/carbon/monkey))
src.attack_paw(usr)
usr.UnarmedAttack(src)
return

View File

@@ -65,7 +65,8 @@
shadeColour = input(user, "Please select the shade colour.", "Crayon colour") as color
return
/obj/item/toy/crayon/afterattack(atom/target, mob/user as mob)
/obj/item/toy/crayon/afterattack(atom/target, mob/user as mob, proximity)
if(!proximity) return
if(istype(target,/turf/simulated/floor))
var/drawtype = input("Choose what you'd like to draw.", "Crayon scribbles") in list("graffiti","rune","letter")
switch(drawtype)

View File

@@ -518,7 +518,8 @@ var/global/list/obj/item/device/pda/PDAs = list()
var/mob/living/U = usr
//Looking for master was kind of pointless since PDAs don't appear to have one.
//if ((src in U.contents) || ( istype(loc, /turf) && in_range(src, U) ) )
if (usr.stat == DEAD)
return 0
if(can_use()) //Why reinvent the wheel? There's a proc that does exactly that.
add_fingerprint(U)
@@ -1017,7 +1018,8 @@ var/global/list/obj/item/device/pda/PDAs = list()
else
user.show_message("\blue No radiation detected.")
/obj/item/device/pda/afterattack(atom/A as mob|obj|turf|area, mob/user as mob)
/obj/item/device/pda/afterattack(atom/A as mob|obj|turf|area, mob/user as mob, proximity)
if(!proximity) return
switch(scanmode)
if(3)

View File

@@ -1,7 +1,7 @@
/obj/item/device/chameleon
name = "chameleon-projector"
icon_state = "shield0"
flags = FPRINT | TABLEPASS| CONDUCT | USEDELAY
flags = FPRINT | TABLEPASS| CONDUCT
slot_flags = SLOT_BELT
item_state = "electronic"
throwforce = 5.0
@@ -19,7 +19,8 @@
attack_self()
toggle()
afterattack(atom/target, mob/user , flag)
afterattack(atom/target, mob/user, proximity)
if(!proximity) return
if(istype(target,/obj/item))
playsound(src, 'sound/weapons/flash.ogg', 100, 1, 1)
user << "\blue Scanned [target]."

View File

@@ -28,7 +28,7 @@
var/message = copytext(sanitize(input(user, "Shout a message?", "Megaphone", null) as text),1,MAX_MESSAGE_LEN)
if(!message)
return
message = capitalize(message)
if ((src.loc == user && usr.stat == 0))
if(emagged)
if(insults)

View File

@@ -5,13 +5,18 @@
anchored = 1
w_class = 4.0
canhear_range = 2
flags = FPRINT | CONDUCT | TABLEPASS | NOBLOODY
var/number = 0
var/anyai = 1
var/mob/living/silicon/ai/ai = list()
var/last_tick //used to delay the powercheck
/obj/item/device/radio/intercom/New()
spawn(5)
checkpower()
..()
processing_objects += src
/obj/item/device/radio/intercom/Del()
processing_objects -= src
..()
/obj/item/device/radio/intercom/attack_ai(mob/user as mob)
@@ -51,10 +56,9 @@
return
..()
/obj/item/device/radio/intercom/proc/checkpower()
// Simple loop, checks for power. Strictly for intercoms
while(src)
/obj/item/device/radio/intercom/process()
if(((world.timeofday - last_tick) > 30) || ((world.timeofday - last_tick) < 0))
last_tick = world.timeofday
if(!src.loc)
on = 0
@@ -69,5 +73,3 @@
icon_state = "intercom-p"
else
icon_state = "intercom"
sleep(30)

View File

@@ -1,128 +0,0 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
/obj/item/tk_grab
name = "Telekinetic Grab"
desc = "Magic"
icon = 'icons/obj/magic.dmi'//Needs sprites
icon_state = "2"
flags = USEDELAY
//item_state = null
w_class = 10.0
layer = 20
var/last_throw = 0
var/obj/focus = null
var/mob/living/host = null
dropped(mob/user as mob)
del(src)
return
//stops TK grabs being equipped anywhere but into hands
equipped(var/mob/user, var/slot)
if( (slot == slot_l_hand) || (slot== slot_r_hand) ) return
del(src)
return
/*
attack_self(mob/user as mob)
if(!istype(focus,/obj/item)) return
if(!check_path()) return//No clear path
user.put_in_hands(focus)
add_fingerprint(user)
user.update_inv_l_hand(0)
user.update_inv_r_hand()
spawn(0)
del(src)
return
*/
afterattack(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, flag)//TODO: go over this
if(!target || !user) return
if(last_throw+3 > world.time) return
if(!host)
del(src)
return
if(!(TK in host.mutations))
del(src)
return
if(isobj(target))
if(!target.loc || !isturf(target.loc))
del(src)
return
if(!focus)
focus_object(target, user)
return
var/focusturf = get_turf(focus)
if(get_dist(focusturf, target) <= 1 && !istype(target, /turf))
target.attackby(focus, user, user:get_organ_target())
else if(get_dist(focusturf, target) <= 16)
apply_focus_overlay()
focus.throw_at(target, 10, 1)
last_throw = world.time
return
proc/focus_object(var/obj/target, var/mob/living/user)
if(!istype(target,/obj)) return//Cant throw non objects atm might let it do mobs later
if(target.anchored)
target.attack_hand(user) // you can use shit now!
return//No throwing anchored things
if(!isturf(target.loc))
return
focus = target
update_icon()
apply_focus_overlay()
return
proc/apply_focus_overlay()
if(!focus) return
var/obj/effect/overlay/O = new /obj/effect/overlay(locate(focus.x,focus.y,focus.z))
O.name = "sparkles"
O.anchored = 1
O.density = 0
O.layer = FLY_LAYER
O.dir = pick(cardinal)
O.icon = 'icons/effects/effects.dmi'
O.icon_state = "nothing"
flick("empdisable",O)
spawn(5)
O.delete()
return
update_icon()
overlays.Cut()
if(focus && focus.icon && focus.icon_state)
overlays += icon(focus.icon,focus.icon_state)
return
/*Not quite done likely needs to use something thats not get_step_to
proc/check_path()
var/turf/ref = get_turf(src.loc)
var/turf/target = get_turf(focus.loc)
if(!ref || !target) return 0
var/distance = get_dist(ref, target)
if(distance >= 10) return 0
for(var/i = 1 to distance)
ref = get_step_to(ref, target, 0)
if(ref != target) return 0
return 1
*/
//equip_to_slot_or_del(obj/item/W, slot, del_on_fail = 1)
/*
if(istype(user, /mob/living/carbon))
if(user:mutations & TK && get_dist(source, user) <= 7)
if(user:get_active_hand()) return 0
var/X = source:x
var/Y = source:y
var/Z = source:z
*/

View File

@@ -37,7 +37,8 @@
/obj/item/toy/balloon/attack(mob/living/carbon/human/M as mob, mob/user as mob)
return
/obj/item/toy/balloon/afterattack(atom/A as mob|obj, mob/user as mob)
/obj/item/toy/balloon/afterattack(atom/A as mob|obj, mob/user as mob, proximity)
if(!proximity) return
if (istype(A, /obj/structure/reagent_dispensers/watertank) && get_dist(src,A) <= 1)
A.reagents.trans_to(src, 10)
user << "\blue You fill the balloon with the contents of [A]."
@@ -122,7 +123,7 @@
icon = 'icons/obj/gun.dmi'
icon_state = "revolver"
item_state = "gun"
flags = FPRINT | TABLEPASS | CONDUCT | USEDELAY
flags = FPRINT | TABLEPASS | CONDUCT
slot_flags = SLOT_BELT
w_class = 3.0
g_amt = 10
@@ -200,7 +201,7 @@
icon = 'icons/obj/gun.dmi'
icon_state = "crossbow"
item_state = "crossbow"
flags = FPRINT | TABLEPASS | USEDELAY
flags = FPRINT | TABLEPASS
w_class = 2.0
attack_verb = list("attacked", "struck", "hit")
var/bullets = 5
@@ -417,7 +418,7 @@
icon_state = "sunflower"
item_state = "sunflower"
var/empty = 0
flags = USEDELAY
flags
/obj/item/toy/waterflower/New()
var/datum/reagents/R = new/datum/reagents(10)

View File

@@ -78,7 +78,8 @@ RCD
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
afterattack(atom/A, mob/user)
afterattack(atom/A, mob/user, proximity)
if(!proximity) return
if(disabled && !isrobot(user))
return 0
if(istype(A,/area/shuttle)||istype(A,/turf/space/transit))

View File

@@ -61,7 +61,8 @@ RSF
return
// Change mode
/obj/item/weapon/rsf/afterattack(atom/A, mob/user as mob)
/obj/item/weapon/rsf/afterattack(atom/A, mob/user as mob, proximity)
if(!proximity) return
if (!(istype(A, /obj/structure/table) || istype(A, /turf/simulated/floor)))
return

View File

@@ -200,7 +200,8 @@
access = list(access_maint_tunnels, access_syndicate, access_external_airlocks)
origin_tech = "syndicate=3"
/obj/item/weapon/card/id/syndicate/afterattack(var/obj/item/weapon/O as obj, mob/user as mob)
/obj/item/weapon/card/id/syndicate/afterattack(var/obj/item/weapon/O as obj, mob/user as mob, proximity)
if(!proximity) return
if(istype(O, /obj/item/weapon/card/id))
var/obj/item/weapon/card/id/I = O
src.access |= I.access

View File

@@ -114,8 +114,9 @@ CIGARETTE PACKETS ARE IN FANCY.DM
return
/obj/item/clothing/mask/cigarette/afterattack(obj/item/weapon/reagent_containers/glass/glass, mob/user as mob)
/obj/item/clothing/mask/cigarette/afterattack(obj/item/weapon/reagent_containers/glass/glass, mob/user as mob, proximity)
..()
if(!proximity) return
if(istype(glass)) //you can dip cigarettes into beakers
var/transfered = glass.reagents.trans_to(src, chem_volume)
if(transfered) //if reagents were transfered, show the message

View File

@@ -35,7 +35,8 @@
M.Stun(3)
M.Weaken(2)
/obj/item/weapon/soap/afterattack(atom/target, mob/user as mob)
/obj/item/weapon/soap/afterattack(atom/target, mob/user as mob, proximity)
if(!proximity) return
//I couldn't feasibly fix the overlay bugs caused by cleaning items we are wearing.
//So this is a workaround. This also makes more sense from an IC standpoint. ~Carn
if(user.client && (target in user.client.screen))

View File

@@ -5,7 +5,7 @@
icon_state = "fire_extinguisher0"
item_state = "fire_extinguisher"
hitsound = 'sound/weapons/smash.ogg'
flags = FPRINT | USEDELAY | TABLEPASS | CONDUCT
flags = FPRINT | TABLEPASS | CONDUCT
throwforce = 10
w_class = 3.0
throw_speed = 2
@@ -24,7 +24,7 @@
icon_state = "miniFE0"
item_state = "miniFE"
hitsound = null //it is much lighter, after all.
flags = FPRINT | USEDELAY | TABLEPASS
flags = FPRINT | TABLEPASS
throwforce = 2
w_class = 2.0
force = 3.0

View File

@@ -4,7 +4,7 @@
icon = 'icons/obj/flamethrower.dmi'
icon_state = "flamethrowerbase"
item_state = "flamethrower_0"
flags = FPRINT | TABLEPASS| CONDUCT | USEDELAY // USEDELAY flag needed in order to use afterattack() for things that are not in reach. I.E: Shooting flames.
flags = FPRINT | TABLEPASS| CONDUCT
force = 3.0
throwforce = 10.0
throw_speed = 1
@@ -60,7 +60,8 @@
item_state = "flamethrower_0"
return
/obj/item/weapon/flamethrower/afterattack(atom/target, mob/user, flag)
/obj/item/weapon/flamethrower/afterattack(atom/target, mob/user, proximity)
if(!proximity) return
// Make sure our user is still holding us
if(user && user.get_active_hand() == src)
var/turf/target_turf = get_turf(target)

View File

@@ -5,7 +5,7 @@
icon_state = "flashbang"
det_time = 20
item_state = "flashbang"
flags = FPRINT | TABLEPASS | USEDELAY
flags = FPRINT | TABLEPASS
slot_flags = SLOT_BELT
var/datum/effect/effect/system/bad_smoke_spread/smoke

View File

@@ -145,7 +145,8 @@
else
user.take_organ_damage(0,force)
/obj/item/weapon/grown/nettle/afterattack(atom/A as mob|obj, mob/user as mob)
/obj/item/weapon/grown/nettle/afterattack(atom/A as mob|obj, mob/user as mob, proximity)
if(!proximity) return
if(force > 0)
force -= rand(1,(force/3)+1) // When you whack someone with it, leaves fall off
playsound(loc, 'sound/weapons/bladeslice.ogg', 50, 1, -1)
@@ -191,7 +192,8 @@
M.Weaken(force/15)
M.drop_item()
/obj/item/weapon/grown/deathnettle/afterattack(atom/A as mob|obj, mob/user as mob)
/obj/item/weapon/grown/deathnettle/afterattack(atom/A as mob|obj, mob/user as mob, proximity)
if(!proximity) return
if (force > 0)
force -= rand(1,(force/3)+1) // When you whack someone with it, leaves fall off

View File

@@ -1,5 +1,6 @@
/obj/item/weapon/melee/energy
var/active = 0
flags = FPRINT | TABLEPASS | NOBLOODY
suicide_act(mob/user)
viewers(user) << pick("\red <b>[user] is slitting \his stomach open with the [src.name]! It looks like \he's trying to commit seppuku.</b>", \
@@ -15,7 +16,7 @@
throw_speed = 1
throw_range = 5
w_class = 3.0
flags = FPRINT | CONDUCT | NOSHIELD | TABLEPASS
flags = FPRINT | CONDUCT | NOSHIELD | TABLEPASS | NOBLOODY
origin_tech = "combat=3"
attack_verb = list("attacked", "chopped", "cleaved", "torn", "cut")
@@ -33,7 +34,7 @@
throw_speed = 1
throw_range = 5
w_class = 2.0
flags = FPRINT | TABLEPASS | NOSHIELD
flags = FPRINT | TABLEPASS | NOSHIELD | NOBLOODY
origin_tech = "magnets=3;syndicate=4"
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
@@ -51,6 +52,6 @@
throw_speed = 1
throw_range = 1
w_class = 4.0//So you can't hide it in your pocket or some such.
flags = FPRINT | TABLEPASS | NOSHIELD
flags = FPRINT | TABLEPASS | NOSHIELD | NOBLOODY
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
var/datum/effect/effect/system/spark_spread/spark_system

View File

@@ -28,7 +28,8 @@ obj/item/weapon/mop/proc/clean(turf/simulated/A)
reagents.remove_any(1) //reaction() doesn't use up the reagents
/obj/item/weapon/mop/afterattack(atom/A, mob/user)
/obj/item/weapon/mop/afterattack(atom/A, mob/user, proximity)
if(!proximity) return
if(istype(A, /turf/simulated) || istype(A, /obj/effect/decal/cleanable) || istype(A, /obj/effect/overlay) || istype(A, /obj/effect/rune))
if(reagents.total_volume < 1)
user << "<span class='notice'>Your mop is dry!</span>"

View File

@@ -17,7 +17,8 @@ var/global/list/cached_icons = list()
flags = FPRINT | OPENCONTAINER
var/paint_type = ""
afterattack(turf/simulated/target, mob/user , flag)
afterattack(turf/simulated/target, mob/user, proximity)
if(!proximity) return
if(istype(target) && reagents.total_volume > 5)
for(var/mob/O in viewers(user))
O.show_message("\red \The [target] has been splashed with something by [user]!", 1)
@@ -139,7 +140,8 @@ var/global/list/cached_icons = list()
return
/obj/item/weapon/paint/afterattack(turf/target, mob/user as mob)
/obj/item/weapon/paint/afterattack(turf/target, mob/user as mob, proximity)
if(!proximity) return
if(!istype(target) || istype(target, /turf/space))
return
var/ind = "[initial(target.icon)][color]"

View File

@@ -161,3 +161,9 @@
can_hold = list(
"/obj/item/clothing/mask/luchador"
)
/obj/item/weapon/storage/belt/inflatable
name = "inflatable duck"
desc = "No bother to sink or swim when you can just float!"
icon_state = "inflatable"
item_state = "inflatable"

View File

@@ -88,7 +88,8 @@
playsound(src.loc, "punch", 25, 1, -1)
return
*/
/obj/item/weapon/storage/bible/afterattack(atom/A, mob/user as mob)
/obj/item/weapon/storage/bible/afterattack(atom/A, mob/user as mob, proximity)
if(!proximity) return
/* if (istype(A, /turf/simulated/floor))
user << "\blue You hit the floor with the bible."
if(user.mind && (user.mind.assigned_role == "Chaplain"))

View File

@@ -27,6 +27,7 @@
/obj/item/weapon/storage/fancy/examine()
set src in oview(1)
..()
if(contents.len <= 0)
usr << "There are no [src.icon_type]s left in the box."
else if(contents.len == 1)

View File

@@ -26,6 +26,14 @@
/obj/item/weapon/storage/MouseDrop(obj/over_object as obj)
if (ishuman(usr) || ismonkey(usr)) //so monkeys can take off their backpacks -- Urist
var/mob/M = usr
if(over_object == M && Adjacent(M)) // this must come before the screen objects only block
orient2hud(M) // dunno why it wasn't before
if(M.s_active)
M.s_active.close(M)
show_to(M)
return
if (!( istype(over_object, /obj/screen) ))
return ..()
if (!(src.loc == usr) || (src.loc && src.loc.loc == usr))
@@ -300,17 +308,17 @@
if(isrobot(user))
user << "\blue You're a robot. No."
return //Robots can't interact with storage items.
return 1 //Robots can't interact with storage items.
if(!can_be_inserted(W))
return
return 1
if(istype(W, /obj/item/weapon/tray))
var/obj/item/weapon/tray/T = W
if(T.calc_carry() > 0)
if(prob(85))
user << "\red The tray won't fit in [src]."
return
return 1
else
W.loc = user.loc
if ((user.client && user.s_active != src))
@@ -319,20 +327,11 @@
user << "\red God damnit!"
handle_item_insertion(W)
return
return 1
/obj/item/weapon/storage/dropped(mob/user as mob)
return
/obj/item/weapon/storage/MouseDrop(over_object, src_location, over_location)
..()
orient2hud(usr)
if ((over_object == usr && (in_range(src, usr) || usr.contents.Find(src))))
if (usr.s_active)
usr.s_active.close(usr)
src.show_to(usr)
return
/obj/item/weapon/storage/attack_hand(mob/user as mob)
playsound(src.loc, "rustle", 50, 1, -5)

View File

@@ -243,7 +243,8 @@
location.hotspot_expose(700, 5)
/obj/item/weapon/weldingtool/afterattack(obj/O as obj, mob/user as mob)
/obj/item/weapon/weldingtool/afterattack(obj/O as obj, mob/user as mob, proximity)
if(!proximity) return
if (istype(O, /obj/structure/reagent_dispensers/fueltank) && get_dist(src,O) <= 1 && !src.welding)
O.reagents.trans_to(src, max_fuel)
user << "\blue Welder refueled"

View File

@@ -119,7 +119,8 @@
icon_state = "fireaxe[wielded]"
return
/obj/item/weapon/twohanded/fireaxe/afterattack(atom/A as mob|obj|turf|area, mob/user as mob)
/obj/item/weapon/twohanded/fireaxe/afterattack(atom/A as mob|obj|turf|area, mob/user as mob, proximity)
if(!proximity) return
..()
if(A && wielded && (istype(A,/obj/structure/window) || istype(A,/obj/structure/grille))) //destroys windows and grilles in one hit
if(istype(A,/obj/structure/window)) //should just make a window.Break() proc but couldn't bother with it

View File

@@ -165,4 +165,27 @@ LINEN BINS
hidden = null
add_fingerprint(user)
/obj/structure/bedsheetbin/attack_tk(mob/user as mob)
if(amount >= 1)
amount--
var/obj/item/weapon/bedsheet/B
if(sheets.len > 0)
B = sheets[sheets.len]
sheets.Remove(B)
else
B = new /obj/item/weapon/bedsheet(loc)
B.loc = loc
user << "<span class='notice'>You telekinetically remove [B] from [src].</span>"
update_icon()
if(hidden)
hidden.loc = loc
hidden = null
add_fingerprint(user)

View File

@@ -0,0 +1,53 @@
/obj/structure/coatrack
name = "coat rack"
desc = "Rack that holds coats."
icon = 'icons/obj/coatrack.dmi'
icon_state = "coatrack0"
var/obj/item/clothing/suit/coat
var/list/allowed = list(/obj/item/clothing/suit/storage/labcoat, /obj/item/clothing/suit/storage/det_suit)
/obj/structure/coatrack/attack_hand(mob/user as mob)
user.visible_message("[user] takes [coat] off \the [src].", "You take [coat] off the \the [src]")
if(!user.put_in_active_hand(coat))
coat.loc = get_turf(user)
coat = null
update_icon()
/obj/structure/coatrack/attackby(obj/item/weapon/W as obj, mob/user as mob)
var/can_hang = 0
for (var/T in allowed)
if(istype(W,T))
can_hang = 1
if (can_hang && !coat)
user.visible_message("[user] hangs [W] on \the [src].", "You hang [W] on the \the [src]")
coat = W
user.drop_item(src)
coat.loc = src
update_icon()
else
user << "<span class='notice'>You cannot hang [W] on [src]</span>"
return ..()
/obj/structure/coatrack/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
var/can_hang = 0
for (var/T in allowed)
if(istype(mover,T))
can_hang = 1
if (can_hang && !coat)
src.visible_message("[mover] lands on \the [src].")
coat = mover
coat.loc = src
update_icon()
return 0
else
return 1
/obj/structure/coatrack/update_icon()
overlays.Cut()
if (istype(coat, /obj/item/clothing/suit/storage/labcoat))
overlays += image(icon, icon_state = "coat_lab")
if (istype(coat, /obj/item/clothing/suit/storage/labcoat/cmo))
overlays += image(icon, icon_state = "coat_cmo")
if (istype(coat, /obj/item/clothing/suit/storage/det_suit))
overlays += image(icon, icon_state = "coat_det")

View File

@@ -181,6 +181,8 @@
if(src.opened)
if(istype(W, /obj/item/weapon/grab))
src.MouseDrop_T(W:affecting, user) //act like they were dragged onto the closet
if(istype(W,/obj/item/tk_grab))
return 0
if(istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
if(!WT.remove_fuel(0,user))
@@ -255,6 +257,12 @@
src.add_fingerprint(user)
src.toggle(user)
// tk grab then use on self
/obj/structure/closet/attack_self_tk(mob/user as mob)
src.add_fingerprint(user)
if(!src.toggle())
usr << "<span class='notice'>It won't budge!</span>"
/obj/structure/closet/verb/verb_toggleopen()
set src in oview(1)
set category = "Object"

View File

@@ -137,6 +137,15 @@
src.icon_state = text("fireaxe[][][][]closing",hasaxe,src.localopened,src.hitstaken,src.smashed)
spawn(10) update_icon()
attack_tk(mob/user as mob)
if(localopened && fireaxe)
fireaxe.loc = loc
user << "\blue You telekinetically remove the fire axe."
fireaxe = null
update_icon()
return
attack_hand(user)
verb/toggle_openness() //nice name, huh? HUH?! -Erro //YEAH -Agouri
set name = "Open/Close"
set category = "Object"

View File

@@ -1,74 +1,79 @@
/obj/structure/closet/athletic_mixed
name = "athletic wardrobe"
desc = "It's a storage unit for athletic wear."
icon_state = "mixed"
icon_closed = "mixed"
/obj/structure/closet/athletic_mixed/New()
..()
sleep(2)
new /obj/item/clothing/under/shorts/grey(src)
new /obj/item/clothing/under/shorts/black(src)
new /obj/item/clothing/under/shorts/red(src)
new /obj/item/clothing/under/shorts/blue(src)
new /obj/item/clothing/under/shorts/green(src)
new /obj/item/clothing/under/swimsuit/red(src)
new /obj/item/clothing/under/swimsuit/black(src)
new /obj/item/clothing/under/swimsuit/blue(src)
new /obj/item/clothing/under/swimsuit/green(src)
new /obj/item/clothing/under/swimsuit/purple(src)
/obj/structure/closet/boxinggloves
name = "boxing gloves"
desc = "It's a storage unit for gloves for use in the boxing ring."
/obj/structure/closet/boxinggloves/New()
..()
sleep(2)
new /obj/item/clothing/gloves/boxing/blue(src)
new /obj/item/clothing/gloves/boxing/green(src)
new /obj/item/clothing/gloves/boxing/yellow(src)
new /obj/item/clothing/gloves/boxing(src)
/obj/structure/closet/masks
name = "mask closet"
desc = "IT'S A STORAGE UNIT FOR FIGHTER MASKS OLE!"
/obj/structure/closet/masks/New()
..()
sleep(2)
new /obj/item/clothing/mask/luchador(src)
new /obj/item/clothing/mask/luchador/rudos(src)
new /obj/item/clothing/mask/luchador/tecnicos(src)
/obj/structure/closet/lasertag/red
name = "red laser tag equipment"
desc = "It's a storage unit for laser tag equipment."
icon_state = "red"
icon_closed = "red"
/obj/structure/closet/lasertag/red/New()
..()
sleep(2)
new /obj/item/weapon/gun/energy/laser/redtag(src)
new /obj/item/weapon/gun/energy/laser/redtag(src)
new /obj/item/clothing/suit/redtag(src)
new /obj/item/clothing/suit/redtag(src)
/obj/structure/closet/lasertag/blue
name = "blue laser tag equipment"
desc = "It's a storage unit for laser tag equipment."
icon_state = "blue"
icon_closed = "blue"
/obj/structure/closet/lasertag/blue/New()
..()
sleep(2)
new /obj/item/weapon/gun/energy/laser/bluetag(src)
new /obj/item/weapon/gun/energy/laser/bluetag(src)
new /obj/item/clothing/suit/bluetag(src)
/obj/structure/closet/athletic_mixed
name = "athletic wardrobe"
desc = "It's a storage unit for athletic wear."
icon_state = "mixed"
icon_closed = "mixed"
/obj/structure/closet/athletic_mixed/New()
..()
sleep(2)
new /obj/item/clothing/under/shorts/grey(src)
new /obj/item/clothing/under/shorts/black(src)
new /obj/item/clothing/under/shorts/red(src)
new /obj/item/clothing/under/shorts/blue(src)
new /obj/item/clothing/under/shorts/green(src)
new /obj/item/clothing/under/swimsuit/red(src)
new /obj/item/clothing/under/swimsuit/black(src)
new /obj/item/clothing/under/swimsuit/blue(src)
new /obj/item/clothing/under/swimsuit/green(src)
new /obj/item/clothing/under/swimsuit/purple(src)
new /obj/item/clothing/mask/snorkel(src)
new /obj/item/clothing/mask/snorkel(src)
new /obj/item/clothing/shoes/swimmingfins(src)
new /obj/item/clothing/shoes/swimmingfins(src)
/obj/structure/closet/boxinggloves
name = "boxing gloves"
desc = "It's a storage unit for gloves for use in the boxing ring."
/obj/structure/closet/boxinggloves/New()
..()
sleep(2)
new /obj/item/clothing/gloves/boxing/blue(src)
new /obj/item/clothing/gloves/boxing/green(src)
new /obj/item/clothing/gloves/boxing/yellow(src)
new /obj/item/clothing/gloves/boxing(src)
/obj/structure/closet/masks
name = "mask closet"
desc = "IT'S A STORAGE UNIT FOR FIGHTER MASKS OLE!"
/obj/structure/closet/masks/New()
..()
sleep(2)
new /obj/item/clothing/mask/luchador(src)
new /obj/item/clothing/mask/luchador/rudos(src)
new /obj/item/clothing/mask/luchador/tecnicos(src)
/obj/structure/closet/lasertag/red
name = "red laser tag equipment"
desc = "It's a storage unit for laser tag equipment."
icon_state = "red"
icon_closed = "red"
/obj/structure/closet/lasertag/red/New()
..()
sleep(2)
new /obj/item/weapon/gun/energy/laser/redtag(src)
new /obj/item/weapon/gun/energy/laser/redtag(src)
new /obj/item/clothing/suit/redtag(src)
new /obj/item/clothing/suit/redtag(src)
/obj/structure/closet/lasertag/blue
name = "blue laser tag equipment"
desc = "It's a storage unit for laser tag equipment."
icon_state = "blue"
icon_closed = "blue"
/obj/structure/closet/lasertag/blue/New()
..()
sleep(2)
new /obj/item/weapon/gun/energy/laser/bluetag(src)
new /obj/item/weapon/gun/energy/laser/bluetag(src)
new /obj/item/clothing/suit/bluetag(src)
new /obj/item/clothing/suit/bluetag(src)

View File

@@ -37,6 +37,15 @@
opened = !opened
update_icon()
/obj/structure/extinguisher_cabinet/attack_tk(mob/user)
if(has_extinguisher)
has_extinguisher.loc = loc
user << "<span class='notice'>You telekinetically remove [has_extinguisher] from [src].</span>"
has_extinguisher = null
opened = 1
else
opened = !opened
update_icon()
/obj/structure/extinguisher_cabinet/attack_paw(mob/user)
attack_hand(user)

View File

@@ -12,8 +12,8 @@
icon_state = "pine_1"
/obj/structure/flora/tree/pine/New()
..()
icon_state = "pine_[rand(1, 3)]"
..()
/obj/structure/flora/tree/pine/xmas
name = "xmas tree"
@@ -29,8 +29,8 @@
icon_state = "tree_1"
/obj/structure/flora/tree/dead/New()
..()
icon_state = "tree_[rand(1, 6)]"
..()
//grass
@@ -43,23 +43,23 @@
icon_state = "snowgrass1bb"
/obj/structure/flora/grass/brown/New()
..()
icon_state = "snowgrass[rand(1, 3)]bb"
..()
/obj/structure/flora/grass/green
icon_state = "snowgrass1gb"
/obj/structure/flora/grass/green/New()
..()
icon_state = "snowgrass[rand(1, 3)]gb"
..()
/obj/structure/flora/grass/both
icon_state = "snowgrassall1"
/obj/structure/flora/grass/both/New()
..()
icon_state = "snowgrassall[rand(1, 3)]"
..()
//bushes
@@ -70,8 +70,13 @@
anchored = 1
/obj/structure/flora/bush/New()
..()
icon_state = "snowbush[rand(1, 6)]"
..()
/obj/structure/flora/pottedplant
name = "potted plant"
icon = 'icons/obj/plants.dmi'
icon_state = "plant-26"
//newbushes
@@ -82,110 +87,110 @@
anchored = 1
/obj/structure/flora/ausbushes/New()
..()
icon_state = "firstbush_[rand(1, 4)]"
..()
/obj/structure/flora/ausbushes/reedbush
icon_state = "reedbush_1"
/obj/structure/flora/ausbushes/reedbush/New()
..()
icon_state = "reedbush_[rand(1, 4)]"
..()
/obj/structure/flora/ausbushes/leafybush
icon_state = "leafybush_1"
/obj/structure/flora/ausbushes/leafybush/New()
..()
icon_state = "leafybush_[rand(1, 3)]"
..()
/obj/structure/flora/ausbushes/palebush
icon_state = "palebush_1"
/obj/structure/flora/ausbushes/palebush/New()
..()
icon_state = "palebush_[rand(1, 4)]"
..()
/obj/structure/flora/ausbushes/stalkybush
icon_state = "stalkybush_1"
/obj/structure/flora/ausbushes/stalkybush/New()
..()
icon_state = "stalkybush_[rand(1, 3)]"
..()
/obj/structure/flora/ausbushes/grassybush
icon_state = "grassybush_1"
/obj/structure/flora/ausbushes/grassybush/New()
..()
icon_state = "grassybush_[rand(1, 4)]"
..()
/obj/structure/flora/ausbushes/fernybush
icon_state = "fernybush_1"
/obj/structure/flora/ausbushes/fernybush/New()
..()
icon_state = "fernybush_[rand(1, 3)]"
..()
/obj/structure/flora/ausbushes/sunnybush
icon_state = "sunnybush_1"
/obj/structure/flora/ausbushes/sunnybush/New()
..()
icon_state = "sunnybush_[rand(1, 3)]"
..()
/obj/structure/flora/ausbushes/genericbush
icon_state = "genericbush_1"
/obj/structure/flora/ausbushes/genericbush/New()
..()
icon_state = "genericbush_[rand(1, 4)]"
..()
/obj/structure/flora/ausbushes/pointybush
icon_state = "pointybush_1"
/obj/structure/flora/ausbushes/pointybush/New()
..()
icon_state = "pointybush_[rand(1, 4)]"
..()
/obj/structure/flora/ausbushes/lavendergrass
icon_state = "lavendergrass_1"
/obj/structure/flora/ausbushes/lavendergrass/New()
..()
icon_state = "lavendergrass_[rand(1, 4)]"
..()
/obj/structure/flora/ausbushes/ywflowers
icon_state = "ywflowers_1"
/obj/structure/flora/ausbushes/ywflowers/New()
..()
icon_state = "ywflowers_[rand(1, 3)]"
..()
/obj/structure/flora/ausbushes/brflowers
icon_state = "brflowers_1"
/obj/structure/flora/ausbushes/brflowers/New()
..()
icon_state = "brflowers_[rand(1, 3)]"
..()
/obj/structure/flora/ausbushes/ppflowers
icon_state = "ppflowers_1"
/obj/structure/flora/ausbushes/ppflowers/New()
..()
icon_state = "ppflowers_[rand(1, 4)]"
..()
/obj/structure/flora/ausbushes/sparsegrass
icon_state = "sparsegrass_1"
/obj/structure/flora/ausbushes/sparsegrass/New()
..()
icon_state = "sparsegrass_[rand(1, 3)]"
..()
/obj/structure/flora/ausbushes/fullgrass
icon_state = "fullgrass_1"
/obj/structure/flora/ausbushes/fullgrass/New()
..()
icon_state = "fullgrass_[rand(1, 3)]"
icon_state = "fullgrass_[rand(1, 3)]"
..()

View File

@@ -134,13 +134,8 @@
density = 1
layer = 2.0
var/obj/structure/morgue/connected = null
anchored = 1.0
/obj/structure/m_tray/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if (istype(mover, /obj/item/weapon/dummy))
return 1
else
return ..()
anchored = 1
throwpass = 1
/obj/structure/m_tray/attack_paw(mob/user as mob)
return src.attack_hand(user)
@@ -353,13 +348,8 @@
density = 1
layer = 2.0
var/obj/structure/crematorium/connected = null
anchored = 1.0
/obj/structure/c_tray/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if (istype(mover, /obj/item/weapon/dummy))
return 1
else
return ..()
anchored = 1
throwpass = 1
/obj/structure/c_tray/attack_paw(mob/user as mob)
return src.attack_hand(user)

View File

@@ -13,11 +13,10 @@
icon_state = "bed"
var/mob/living/buckled_mob
/obj/structure/stool/psychbed
/obj/structure/stool/bed/psych
name = "psych bed"
desc = "For prime comfort during psychiatric evaluations."
icon_state = "psychbed"
var/mob/living/buckled_mob
/obj/structure/stool/bed/alien
name = "resting contraption"

Some files were not shown because too many files have changed in this diff Show More