Merge branch 'master' of https://github.com/Citadel-Station-13/Citadel-Station-13 into Ghommie-cit765
This commit is contained in:
@@ -581,6 +581,14 @@
|
||||
SEND_SIGNAL(src, COMSIG_ATOM_RCD_ACT, user, the_rcd, passed_mode)
|
||||
return FALSE
|
||||
|
||||
/**
|
||||
* Respond to a electric bolt action on our item
|
||||
*
|
||||
* Default behaviour is to return, we define here to allow for cleaner code later on
|
||||
*/
|
||||
/atom/proc/zap_act(power, zap_flags, shocked_targets)
|
||||
return
|
||||
|
||||
/atom/proc/storage_contents_dump_act(obj/item/storage/src_object, mob/user)
|
||||
if(GetComponent(/datum/component/storage))
|
||||
return component_storage_contents_dump_act(src_object, user)
|
||||
|
||||
@@ -37,6 +37,8 @@
|
||||
var/throwforce = 0
|
||||
var/datum/component/orbiter/orbiting
|
||||
var/can_be_z_moved = TRUE
|
||||
///If we were without gravity and another animation happened, the bouncing will stop, and we need to restart it in next life().
|
||||
var/floating_need_update = FALSE
|
||||
|
||||
var/zfalling = FALSE
|
||||
|
||||
@@ -492,15 +494,16 @@
|
||||
/atom/movable/proc/float(on)
|
||||
if(throwing)
|
||||
return
|
||||
if(on && !(movement_type & FLOATING))
|
||||
if(on && (!(movement_type & FLOATING) || floating_need_update))
|
||||
animate(src, pixel_y = pixel_y + 2, time = 10, loop = -1)
|
||||
sleep(10)
|
||||
animate(src, pixel_y = pixel_y - 2, time = 10, loop = -1)
|
||||
setMovetype(movement_type | FLOATING)
|
||||
else if (!on && (movement_type & FLOATING))
|
||||
if(!(movement_type & FLOATING))
|
||||
setMovetype(movement_type | FLOATING)
|
||||
else if (!on && movement_type & FLOATING)
|
||||
animate(src, pixel_y = initial(pixel_y), time = 10)
|
||||
setMovetype(movement_type & ~FLOATING)
|
||||
|
||||
floating_need_update = FALSE
|
||||
|
||||
/* Language procs
|
||||
* Unless you are doing something very specific, these are the ones you want to use.
|
||||
|
||||
@@ -48,9 +48,6 @@
|
||||
/obj/machinery/dominator/hulk_damage()
|
||||
return (max_integrity - integrity_failure) / DOM_HULK_HITS_REQUIRED
|
||||
|
||||
/obj/machinery/dominator/tesla_act()
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/dominator/update_icon()
|
||||
cut_overlays()
|
||||
if(stat & BROKEN)
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
/obj/effect/decal/cleanable/crayon/gang
|
||||
icon = 'icons/effects/crayondecal.dmi'
|
||||
layer = ABOVE_NORMAL_TURF_LAYER //Harder to hide
|
||||
plane = GAME_PLANE
|
||||
plane = ABOVE_WALL_PLANE
|
||||
do_icon_rotate = FALSE //These are designed to always face south, so no rotation please.
|
||||
var/datum/team/gang/gang
|
||||
|
||||
|
||||
@@ -522,11 +522,11 @@ Class Procs:
|
||||
/obj/machinery/proc/can_be_overridden()
|
||||
. = 1
|
||||
|
||||
/obj/machinery/tesla_act(power, tesla_flags, shocked_objects)
|
||||
..()
|
||||
if(prob(85) && (tesla_flags & TESLA_MACHINE_EXPLOSIVE))
|
||||
/obj/machinery/zap_act(power, zap_flags, shocked_objects)
|
||||
. = ..()
|
||||
if(prob(85) && (zap_flags & ZAP_MACHINE_EXPLOSIVE))
|
||||
explosion(src, 1, 2, 4, flame_range = 2, adminlog = FALSE, smoke = FALSE)
|
||||
if(tesla_flags & TESLA_OBJ_DAMAGE)
|
||||
else if(zap_flags & ZAP_OBJ_DAMAGE)
|
||||
take_damage(power/2000, BURN, "energy")
|
||||
if(prob(40))
|
||||
emp_act(EMP_LIGHT)
|
||||
|
||||
@@ -290,8 +290,6 @@
|
||||
operating = TRUE
|
||||
do_animate("closing")
|
||||
layer = closingLayer
|
||||
if(!safe)
|
||||
crush()
|
||||
sleep(5)
|
||||
density = TRUE
|
||||
sleep(5)
|
||||
@@ -303,6 +301,8 @@
|
||||
update_freelook_sight()
|
||||
if(safe)
|
||||
CheckForMobs()
|
||||
else
|
||||
crush()
|
||||
return 1
|
||||
|
||||
/obj/machinery/door/proc/CheckForMobs()
|
||||
|
||||
@@ -34,7 +34,7 @@ GLOBAL_LIST_EMPTY(network_holopads)
|
||||
desc = "It's a floor-mounted device for projecting holographic images."
|
||||
icon_state = "holopad0"
|
||||
layer = LOW_OBJ_LAYER
|
||||
plane = FLOOR_PLANE
|
||||
plane = ABOVE_WALL_PLANE
|
||||
flags_1 = HEAR_1
|
||||
use_power = IDLE_POWER_USE
|
||||
idle_power_usage = 5
|
||||
|
||||
@@ -115,8 +115,8 @@
|
||||
return PROCESS_KILL
|
||||
|
||||
/obj/machinery/space_heater/RefreshParts()
|
||||
var/laser = 0
|
||||
var/cap = 0
|
||||
var/laser = 2
|
||||
var/cap = 1
|
||||
for(var/obj/item/stock_parts/micro_laser/M in component_parts)
|
||||
laser += M.rating
|
||||
for(var/obj/item/stock_parts/capacitor/M in component_parts)
|
||||
@@ -166,6 +166,11 @@
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/machinery/space_heater/wrench_act(mob/living/user, obj/item/I)
|
||||
..()
|
||||
default_unfasten_wrench(user, I, 5)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/space_heater/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
|
||||
@@ -11,9 +11,6 @@
|
||||
var/insisting = 0
|
||||
|
||||
/obj/machinery/wish_granter/attack_hand(mob/living/carbon/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if(charges <= 0)
|
||||
to_chat(user, "The Wish Granter lies silent.")
|
||||
return
|
||||
@@ -22,22 +19,116 @@
|
||||
to_chat(user, "You feel a dark stirring inside of the Wish Granter, something you want nothing of. Your instincts are better than any man's.")
|
||||
return
|
||||
|
||||
else if(is_special_character(user))
|
||||
to_chat(user, "Even to a heart as dark as yours, you know nothing good will come of this. Something instinctual makes you pull away.")
|
||||
|
||||
else if (!insisting)
|
||||
to_chat(user, "Your first touch makes the Wish Granter stir, listening to you. Are you really sure you want to do this?")
|
||||
insisting++
|
||||
|
||||
else
|
||||
to_chat(user, "You speak. [pick("I want the station to disappear","Humanity is corrupt, mankind must be destroyed","I want to be rich", "I want to rule the world","I want immortality.")]. The Wish Granter answers.")
|
||||
to_chat(user, "Your head pounds for a moment, before your vision clears. You are the avatar of the Wish Granter, and your power is LIMITLESS! And it's all yours. You need to make sure no one can take it from you. No one can know, first.")
|
||||
if(is_special_character(user))
|
||||
to_chat(user, "You speak. [pick("I want power","Humanity is corrupt, mankind must be destroyed", "I want to rule the world","I want immortality")]. The Wish Granter answers.")
|
||||
to_chat(user, "Your head pounds for a moment, before your vision clears. The Wish Granter, sensing the darkness in your heart, has given you limitless power, and it's all yours!")
|
||||
user.dna.add_mutation(HULK)
|
||||
user.dna.add_mutation(XRAY)
|
||||
user.dna.add_mutation(SPACEMUT)
|
||||
user.dna.add_mutation(TK)
|
||||
user.next_move_modifier *= 0.5 //half the delay between attacks!
|
||||
to_chat(user, "Things around you feel slower!")
|
||||
charges--
|
||||
insisting = FALSE
|
||||
to_chat(user, "You have a very great feeling about this!")
|
||||
else
|
||||
to_chat(user, "The Wish Granter awaits your wish.")
|
||||
var/wish = input("You want...","Wish") as null|anything in list("Power","Wealth","The Station To Disappear","To Kill","Nothing")
|
||||
switch(wish)
|
||||
if("Power") //Gives infinite power in exchange for infinite power going off in your face!
|
||||
if(charges <= 0)
|
||||
return
|
||||
to_chat(user, "<B>Your wish is granted, but at a terrible cost...</B>")
|
||||
to_chat(user, "The Wish Granter punishes you for your selfishness, warping itself into a delaminating supermatter shard!")
|
||||
var/obj/item/stock_parts/cell/infinite/powah = new /obj/item/stock_parts/cell/infinite(get_turf(user))
|
||||
if(user.put_in_hands(powah))
|
||||
to_chat(user, "[powah] materializes into your hands!")
|
||||
else
|
||||
to_chat(user, "[powah] materializes onto the floor.")
|
||||
var/obj/machinery/power/supermatter_crystal/powerwish = new /obj/machinery/power/supermatter_crystal(loc)
|
||||
powerwish.damage = 700 //right at the emergency threshold
|
||||
powerwish.produces_gas = FALSE
|
||||
charges--
|
||||
insisting = FALSE
|
||||
if(!charges)
|
||||
qdel(src)
|
||||
if("Wealth") //Gives 1 million space bucks in exchange for being turned into gold!
|
||||
if(charges <= 0)
|
||||
return
|
||||
to_chat(user, "<B>Your wish is granted, but at a cost...</B>")
|
||||
to_chat(user, "The Wish Granter punishes you for your selfishness, warping your body to match the greed in your heart.")
|
||||
new /obj/structure/closet/crate/trashcart/moneywish(loc)
|
||||
new /obj/structure/closet/crate/trashcart/moneywish(loc)
|
||||
user.set_species(/datum/species/golem/gold)
|
||||
charges--
|
||||
insisting = FALSE
|
||||
if(!charges)
|
||||
qdel(src)
|
||||
if("The Station To Disappear") //teleports you to the station and makes you blind, making the station disappear for you!
|
||||
if(charges <= 0)
|
||||
return
|
||||
to_chat(user, "<B>Your wish is 'granted', but at a terrible cost...</B>")
|
||||
to_chat(user, "The Wish Granter punishes you for your selfishness, claiming your soul and warping your eyes to match the darkness in your heart.")
|
||||
user.dna.add_mutation(BLINDMUT)
|
||||
var/obj/item/organ/eyes/eyes = user.getorganslot(ORGAN_SLOT_EYES)
|
||||
if(eyes)
|
||||
eyes.applyOrganDamage(eyes.maxHealth)
|
||||
var/list/destinations = list()
|
||||
for(var/obj/item/beacon/B in GLOB.teleportbeacons)
|
||||
var/turf/T = get_turf(B)
|
||||
if(is_station_level(T.z))
|
||||
destinations += B
|
||||
var/chosen_beacon = pick(destinations)
|
||||
var/obj/effect/portal/jaunt_tunnel/J = new (get_turf(src), src, 100, null, FALSE, get_turf(chosen_beacon))
|
||||
try_move_adjacent(J)
|
||||
playsound(src,'sound/effects/sparks4.ogg',50,1)
|
||||
charges--
|
||||
insisting = FALSE
|
||||
if(!charges)
|
||||
qdel(src)
|
||||
if("To Kill") //Makes you kill things in exchange for rewards!
|
||||
if(charges <= 0)
|
||||
return
|
||||
to_chat(user, "<B>Your wish is granted, but at a terrible cost...</B>")
|
||||
to_chat(user, "The Wish Granter punishes you for your wickedness, warping itself into a dastardly creature for you to kill! ...but it almost seems to reward you for this.")
|
||||
var/obj/item/melee/transforming/energy/sword/cx/killreward = new /obj/item/melee/transforming/energy/sword/cx(get_turf(user))
|
||||
if(user.put_in_hands(killreward))
|
||||
to_chat(user, "[killreward] materializes into your hands!")
|
||||
else
|
||||
to_chat(user, "[killreward] materializes onto the floor.")
|
||||
user.next_move_modifier *= 0.8 //20% less delay between attacks!
|
||||
to_chat(user, "Things around you feel slightly slower!")
|
||||
var/mob/living/simple_animal/hostile/venus_human_trap/killwish = new /mob/living/simple_animal/hostile/venus_human_trap(loc)
|
||||
killwish.maxHealth = 1500
|
||||
killwish.health = killwish.maxHealth
|
||||
killwish.vine_grab_distance = 6
|
||||
killwish.melee_damage_upper = 30
|
||||
killwish.loot = list(/obj/item/dualsaber/hypereutactic)
|
||||
charges--
|
||||
insisting = FALSE
|
||||
if(!charges)
|
||||
qdel(src)
|
||||
if("Nothing") //Makes the wish granter disappear
|
||||
if(charges <= 0)
|
||||
return
|
||||
to_chat(user, "<B>The Wish Granter vanishes from sight!</B>")
|
||||
to_chat(user, "You feel as if you just narrowly avoided a terrible fate...")
|
||||
charges--
|
||||
insisting = FALSE
|
||||
qdel(src)
|
||||
|
||||
charges--
|
||||
insisting = 0
|
||||
//ITEMS THAT IT USES
|
||||
|
||||
user.mind.add_antag_datum(/datum/antagonist/wishgranter)
|
||||
/obj/structure/closet/crate/trashcart/moneywish
|
||||
desc = "A heavy, metal trashcart with wheels. Filled with cash."
|
||||
name = "loaded trash cart"
|
||||
|
||||
to_chat(user, "You have a very bad feeling about this.")
|
||||
|
||||
return
|
||||
/obj/structure/closet/crate/trashcart/moneywish/PopulateContents() //25*20*1000=500,000
|
||||
for(var/i in 1 to 25)
|
||||
var/obj/item/stack/spacecash/c1000/lodsamoney = new /obj/item/stack/spacecash/c1000(src)
|
||||
lodsamoney.amount = lodsamoney.max_amount
|
||||
|
||||
@@ -62,18 +62,21 @@
|
||||
|
||||
/obj/mecha/combat/neovgre/process()
|
||||
..()
|
||||
if(GLOB.ratvar_awakens) // At this point only timley intervention by lord singulo could hople to stop the superweapon
|
||||
if(GLOB.ratvar_awakens) // At this point only timley intervention by lord singulo could hope to stop the superweapon
|
||||
cell.charge = INFINITY
|
||||
max_integrity = INFINITY
|
||||
obj_integrity = max_integrity
|
||||
CHECK_TICK //Just to be on the safe side lag wise
|
||||
else if(cell.charge < cell.maxcharge)
|
||||
for(var/obj/effect/clockwork/sigil/transmission/T in range(SIGIL_ACCESS_RANGE, src))
|
||||
var/delta = min(recharge_rate, cell.maxcharge - cell.charge)
|
||||
if (get_clockwork_power() <= delta)
|
||||
cell.charge += delta
|
||||
adjust_clockwork_power(-delta)
|
||||
CHECK_TICK
|
||||
else
|
||||
if(cell.charge < cell.maxcharge)
|
||||
for(var/obj/effect/clockwork/sigil/transmission/T in range(SIGIL_ACCESS_RANGE, src))
|
||||
var/delta = min(recharge_rate, cell.maxcharge - cell.charge)
|
||||
if (get_clockwork_power() >= delta)
|
||||
cell.charge += delta
|
||||
adjust_clockwork_power(-delta)
|
||||
if(obj_integrity < max_integrity && istype(loc, /turf/open/floor/clockwork))
|
||||
obj_integrity += min(max_integrity - obj_integrity, max_integrity / 200)
|
||||
CHECK_TICK
|
||||
|
||||
/obj/mecha/combat/neovgre/Initialize()
|
||||
.=..()
|
||||
@@ -90,7 +93,7 @@
|
||||
energy_drain = 30
|
||||
name = "Aribter Laser Cannon"
|
||||
desc = "Please re-attach this to neovgre and stop asking questions about why it looks like a normal Nanotrasen issue Solaris laser cannon - Nezbere"
|
||||
fire_sound = "sound/weapons/neovgre_laser.ogg"
|
||||
fire_sound = 'sound/weapons/neovgre_laser.ogg'
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/weapon/energy/laser/heavy/neovgre/can_attach(obj/mecha/combat/neovgre/M)
|
||||
if(istype(M))
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
/obj/mecha/attack_animal(mob/living/simple_animal/user)
|
||||
mecha_log_message("Attack by simple animal. Attacker - [user].", color="red")
|
||||
if(!user.melee_damage_upper && !user.obj_damage)
|
||||
user.emote("custom", message = "[user.friendly] [src].")
|
||||
user.emote("custom", message = "[user.friendly_verb_continuous] [src].")
|
||||
return 0
|
||||
else
|
||||
var/play_soundeffect = 1
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
desc = "Graffiti. Damn kids."
|
||||
icon = 'icons/effects/crayondecal.dmi'
|
||||
icon_state = "rune1"
|
||||
plane = GAME_PLANE //makes the graffiti visible over a wall.
|
||||
plane = ABOVE_WALL_PLANE //makes the graffiti visible over a wall.
|
||||
gender = NEUTER
|
||||
mergeable_decal = FALSE
|
||||
var/do_icon_rotate = TRUE
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
icon = 'icons/turf/decals.dmi'
|
||||
icon_state = "warningline"
|
||||
layer = TURF_DECAL_LAYER
|
||||
plane = ABOVE_WALL_PLANE
|
||||
|
||||
/obj/effect/turf_decal/Initialize()
|
||||
..()
|
||||
|
||||
@@ -469,6 +469,7 @@ INITIALIZE_IMMEDIATE(/obj/effect/landmark/start/new_player)
|
||||
/obj/effect/landmark/stationroom
|
||||
var/list/templates = list()
|
||||
layer = BULLET_HOLE_LAYER
|
||||
plane = ABOVE_WALL_PLANE
|
||||
|
||||
/obj/effect/landmark/stationroom/New()
|
||||
..()
|
||||
|
||||
@@ -135,7 +135,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
|
||||
///Skills vars
|
||||
//list of skill PATHS exercised when using this item. An associated bitfield can be set to indicate additional ways the skill is used by this specific item.
|
||||
var/list/datum/skill/used_skills
|
||||
var/skill_difficulty = THRESHOLD_COMPETENT //how difficult it's to use this item in general.
|
||||
var/skill_difficulty = THRESHOLD_UNTRAINED //how difficult it's to use this item in general.
|
||||
var/skill_gain = DEF_SKILL_GAIN //base skill value gain from using this item.
|
||||
|
||||
/obj/item/Initialize()
|
||||
@@ -805,7 +805,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
|
||||
|
||||
if(delay)
|
||||
if(user.mind && used_skills)
|
||||
delay = user.mind.item_action_skills_mod(src, delay, skill_difficulty, SKILL_USE_TOOL, NONE, FALSE)
|
||||
delay = user.mind.item_action_skills_mod(src, delay, skill_difficulty, SKILL_USE_TOOL, null, FALSE)
|
||||
|
||||
// Create a callback with checks that would be called every tick by do_after.
|
||||
var/datum/callback/tool_check = CALLBACK(src, .proc/tool_check_callback, user, amount, extra_checks)
|
||||
@@ -831,11 +831,13 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
|
||||
if(delay >= MIN_TOOL_SOUND_DELAY)
|
||||
play_tool_sound(target, volume)
|
||||
|
||||
|
||||
if(user.mind && used_skills && skill_gain_mult)
|
||||
var/gain = skill_gain + delay/SKILL_GAIN_DELAY_DIVISOR
|
||||
for(var/skill in used_skills)
|
||||
if(!(used_skills[skill] & SKILL_TRAINING_TOOL))
|
||||
if(!(SKILL_TRAINING_TOOL in used_skills[skill]))
|
||||
continue
|
||||
user.mind.auto_gain_experience(skill, skill_gain*skill_gain_mult, GET_STANDARD_LVL(max_level))
|
||||
user.mind.auto_gain_experience(skill, gain*skill_gain_mult, GET_STANDARD_LVL(max_level))
|
||||
|
||||
return TRUE
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ RLD
|
||||
//if user can't be seen from A (only checks surroundings' opaqueness) and can't see A.
|
||||
//jarring, but it should stop people from targetting atoms they can't see...
|
||||
//excluding darkness, to allow RLD to be used to light pitch black dark areas.
|
||||
if(!((user in view(view_range, A)) || (user in get_actual_viewers(view_range, A))))
|
||||
if(!((user in view(view_range, A)) || (user in fov_viewers(view_range, A))))
|
||||
to_chat(user, "<span class='warning'>You focus, pointing \the [src] at whatever outside your field of vision in that direction... to no avail.</span>")
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
@@ -58,18 +58,22 @@
|
||||
/obj/item/wallframe/proc/after_attach(var/obj/O)
|
||||
transfer_fingerprints_to(O)
|
||||
|
||||
/obj/item/wallframe/attackby(obj/item/W, mob/user, params)
|
||||
..()
|
||||
if(istype(W, /obj/item/screwdriver))
|
||||
// For camera-building borgs
|
||||
var/turf/T = get_step(get_turf(user), user.dir)
|
||||
if(iswallturf(T))
|
||||
T.attackby(src, user, params)
|
||||
/obj/item/wallframe/screwdriver_act(mob/user, obj/item/I)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
// For camera-building borgs
|
||||
var/turf/T = get_step(get_turf(user), user.dir)
|
||||
if(iswallturf(T))
|
||||
T.attackby(src, user)
|
||||
|
||||
/obj/item/wallframe/wrench_act(mob/user, obj/item/I)
|
||||
if(!custom_materials)
|
||||
return
|
||||
var/metal_amt = round(custom_materials[SSmaterials.GetMaterialRef(/datum/material/iron)]/MINERAL_MATERIAL_AMOUNT)
|
||||
var/glass_amt = round(custom_materials[SSmaterials.GetMaterialRef(/datum/material/glass)]/MINERAL_MATERIAL_AMOUNT)
|
||||
|
||||
if(istype(W, /obj/item/wrench) && (metal_amt || glass_amt))
|
||||
if(metal_amt || glass_amt)
|
||||
to_chat(user, "<span class='notice'>You dismantle [src].</span>")
|
||||
if(metal_amt)
|
||||
new /obj/item/stack/sheet/metal(get_turf(src), metal_amt)
|
||||
|
||||
@@ -91,6 +91,11 @@
|
||||
|
||||
refill()
|
||||
|
||||
/obj/item/toy/crayon/examine(mob/user)
|
||||
. = ..()
|
||||
if(can_change_colour)
|
||||
. += "<span class='notice'>Ctrl-click [src] while it's on your person to quickly recolour it.</span>"
|
||||
|
||||
/obj/item/toy/crayon/proc/refill()
|
||||
if(charges == -1)
|
||||
charges_left = 100
|
||||
@@ -160,6 +165,12 @@
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
/obj/item/toy/crayon/CtrlClick(mob/user)
|
||||
if(can_change_colour && !isturf(loc) && user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
select_colour(user)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/toy/crayon/proc/staticDrawables()
|
||||
|
||||
. = list()
|
||||
@@ -237,14 +248,7 @@
|
||||
else
|
||||
paint_mode = PAINT_NORMAL
|
||||
if("select_colour")
|
||||
if(can_change_colour)
|
||||
var/chosen_colour = input(usr,"","Choose Color",paint_color) as color|null
|
||||
|
||||
if (!isnull(chosen_colour))
|
||||
paint_color = chosen_colour
|
||||
. = TRUE
|
||||
else
|
||||
. = FALSE
|
||||
. = can_change_colour && select_colour(usr)
|
||||
if("enter_text")
|
||||
var/txt = stripped_input(usr,"Choose what to write.",
|
||||
"Scribbles",default = text_buffer)
|
||||
@@ -254,6 +258,13 @@
|
||||
drawtype = "a"
|
||||
update_icon()
|
||||
|
||||
/obj/item/toy/crayon/proc/select_colour(mob/user)
|
||||
var/chosen_colour = input(user, "", "Choose Color", paint_color) as color|null
|
||||
if (!isnull(chosen_colour) && user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
|
||||
paint_color = chosen_colour
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/item/toy/crayon/proc/crayon_text_strip(text)
|
||||
var/static/regex/crayon_r = new /regex(@"[^\w!?,.=%#&+\/\-]")
|
||||
return replacetext(lowertext(text), crayon_r, "")
|
||||
|
||||
@@ -433,7 +433,7 @@
|
||||
H.visible_message("<span class='danger'>The defibrillator safely discharges the excessive charge into the floor!</span>")
|
||||
return
|
||||
var/mob/living/M = H.pulledby
|
||||
if(M.electrocute_act(30, src))
|
||||
if(M.electrocute_act(30, H))
|
||||
M.visible_message("<span class='danger'>[M] is electrocuted by [M.p_their()] contact with [H]!</span>")
|
||||
M.emote("scream")
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@
|
||||
outmsg = "<span class='warning'>You miss the lens of [C] with [src]!</span>"
|
||||
|
||||
//catpeople
|
||||
var/list/viewers = get_actual_viewers(1,targloc)
|
||||
var/list/viewers = fov_viewers(1,targloc)
|
||||
for(var/mob/living/carbon/human/H in viewers)
|
||||
if(!iscatperson(H) || H.incapacitated() || H.eye_blind )
|
||||
continue
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
if(ismob(loc))
|
||||
attack_self(loc)
|
||||
else
|
||||
for(var/mob/M in get_actual_viewers(1, src))
|
||||
for(var/mob/M in fov_viewers(1, src))
|
||||
if(M.client)
|
||||
attack_self(M)
|
||||
add_fingerprint(usr)
|
||||
|
||||
@@ -197,10 +197,10 @@
|
||||
if(obj_integrity >= max_integrity)
|
||||
to_chat(user, "<span class='warning'>[src] is already in perfect condition.</span>")
|
||||
else
|
||||
var/obj/item/stack/sheet/mineral/titanium/T = W
|
||||
T.use(1)
|
||||
var/obj/item/stack/S = W
|
||||
S.use(1)
|
||||
obj_integrity = max_integrity
|
||||
to_chat(user, "<span class='notice'>You repair [src] with [T].</span>")
|
||||
to_chat(user, "<span class='notice'>You repair [src] with [S].</span>")
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
* Wood
|
||||
* Bamboo
|
||||
* Cloth
|
||||
* Silk
|
||||
* Durathread
|
||||
* Cardboard
|
||||
* Runed Metal (cult)
|
||||
@@ -268,6 +267,7 @@ GLOBAL_LIST_INIT(wood_recipes, list ( \
|
||||
new/datum/stack_recipe("apiary", /obj/structure/beebox, 40, time = 50),\
|
||||
null, \
|
||||
new/datum/stack_recipe("picture frame", /obj/item/wallframe/picture, 1, time = 10),\
|
||||
new/datum/stack_recipe("painting frame", /obj/item/wallframe/painting, 1, time = 10),\
|
||||
new/datum/stack_recipe("mortar", /obj/item/reagent_containers/glass/mortar, 3), \
|
||||
new/datum/stack_recipe("honey frame", /obj/item/honey_frame, 5, time = 10),\
|
||||
))
|
||||
@@ -388,6 +388,9 @@ GLOBAL_LIST_INIT(cloth_recipes, list ( \
|
||||
null, \
|
||||
new/datum/stack_recipe("blindfold", /obj/item/clothing/glasses/sunglasses/blindfold, 2), \
|
||||
null, \
|
||||
new/datum/stack_recipe("19x19 canvas", /obj/item/canvas/nineteenXnineteen, 3), \
|
||||
new/datum/stack_recipe("23x19 canvas", /obj/item/canvas/twentythreeXnineteen, 4), \
|
||||
new/datum/stack_recipe("23x23 canvas", /obj/item/canvas/twentythreeXtwentythree, 5), \
|
||||
))
|
||||
|
||||
/obj/item/stack/sheet/cloth
|
||||
@@ -401,7 +404,6 @@ GLOBAL_LIST_INIT(cloth_recipes, list ( \
|
||||
throwforce = 0
|
||||
pull_effort = 90
|
||||
is_fabric = TRUE
|
||||
loom_result = /obj/item/stack/sheet/silk
|
||||
merge_type = /obj/item/stack/sheet/cloth
|
||||
|
||||
/obj/item/stack/sheet/cloth/get_main_recipes()
|
||||
@@ -414,30 +416,6 @@ GLOBAL_LIST_INIT(cloth_recipes, list ( \
|
||||
/obj/item/stack/sheet/cloth/thirty
|
||||
amount = 30
|
||||
|
||||
/*
|
||||
* Silk
|
||||
*/
|
||||
|
||||
GLOBAL_LIST_INIT(silk_recipes, list ( \
|
||||
new/datum/stack_recipe("white jumpsuit", /obj/item/clothing/under/color/white, 4, time = 40), \
|
||||
new/datum/stack_recipe("white gloves", /obj/item/clothing/gloves/color/white, 2, time = 40), \
|
||||
null, \
|
||||
new/datum/stack_recipe("silk string", /obj/item/weaponcrafting/silkstring, 1, time = 40), \
|
||||
))
|
||||
|
||||
/obj/item/stack/sheet/silk
|
||||
name = "silk"
|
||||
desc = "A long, soft material. Made out of refined cotton, instead of relying on the habits of spiders or silkworms."
|
||||
singular_name = "silk sheet"
|
||||
icon_state = "sheet-silk"
|
||||
item_state = "sheet-cloth"
|
||||
novariants = TRUE
|
||||
merge_type = /obj/item/stack/sheet/silk
|
||||
|
||||
/obj/item/stack/sheet/silk/get_main_recipes()
|
||||
. = ..()
|
||||
. += GLOB.silk_recipes
|
||||
|
||||
/*
|
||||
* Durathread
|
||||
*/
|
||||
@@ -446,6 +424,7 @@ GLOBAL_LIST_INIT(durathread_recipes, list ( \
|
||||
new/datum/stack_recipe("durathread beret", /obj/item/clothing/head/beret/durathread, 2, time = 40), \
|
||||
new/datum/stack_recipe("durathread beanie", /obj/item/clothing/head/beanie/durathread, 2, time = 40), \
|
||||
new/datum/stack_recipe("durathread bandana", /obj/item/clothing/mask/bandana/durathread, 1, time = 25), \
|
||||
new/datum/stack_recipe("durathread string", /obj/item/weaponcrafting/durathread_string, 1, time = 40) \
|
||||
))
|
||||
|
||||
/obj/item/stack/sheet/durathread
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
switch(contents.len)
|
||||
if(0)
|
||||
icon_state = "[initial(icon_state)]"
|
||||
if(0 to 11)
|
||||
if(1 to 11)
|
||||
icon_state = "[initial(icon_state)]1"
|
||||
if(11 to 20)
|
||||
icon_state = "[initial(icon_state)]2"
|
||||
|
||||
@@ -210,6 +210,7 @@
|
||||
power = 8
|
||||
force = 10
|
||||
precision = 1
|
||||
total_mass = 0.2
|
||||
cooling_power = 5
|
||||
w_class = WEIGHT_CLASS_HUGE
|
||||
item_flags = ABSTRACT // don't put in storage
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
if (ismob(src.loc))
|
||||
attack_self(src.loc)
|
||||
else
|
||||
for(var/mob/M in get_actual_viewers(1, src))
|
||||
for(var/mob/M in fov_viewers(1, src))
|
||||
if (M.client)
|
||||
src.attack_self(M)
|
||||
return
|
||||
|
||||
@@ -478,6 +478,20 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301
|
||||
throw_range = 2
|
||||
attack_verb = list("busted")
|
||||
|
||||
/obj/item/statuebust/attack_self(mob/living/user)
|
||||
add_fingerprint(user)
|
||||
user.examinate(src)
|
||||
|
||||
/obj/item/statuebust/examine(mob/living/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if (!isliving(user))
|
||||
return
|
||||
user.visible_message("[user] stops to admire [src].", \
|
||||
"<span class='notice'>You take in [src], admiring its fine craftsmanship.</span>")
|
||||
SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "artgood", /datum/mood_event/artgood)
|
||||
|
||||
/obj/item/tailclub
|
||||
name = "tail club"
|
||||
desc = "For the beating to death of lizards with their own tails."
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
|
||||
/obj/attack_animal(mob/living/simple_animal/M)
|
||||
if(!M.melee_damage_upper && !M.obj_damage)
|
||||
M.emote("custom", message = "[M.friendly] [src].")
|
||||
M.emote("custom", message = "[M.friendly_verb_continuous] [src].")
|
||||
return 0
|
||||
else
|
||||
var/play_soundeffect = 1
|
||||
@@ -232,15 +232,16 @@ GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/e
|
||||
cut_overlay(GLOB.fire_overlay, TRUE)
|
||||
SSfire_burning.processing -= src
|
||||
|
||||
/obj/proc/tesla_act(power, tesla_flags, shocked_targets)
|
||||
/obj/zap_act(power, zap_flags, shocked_targets)
|
||||
if(QDELETED(src))
|
||||
return 0
|
||||
obj_flags |= BEING_SHOCKED
|
||||
var/power_bounced = power / 2
|
||||
tesla_zap(src, 3, power_bounced, tesla_flags, shocked_targets)
|
||||
addtimer(CALLBACK(src, .proc/reset_shocked), 10)
|
||||
return power / 2
|
||||
|
||||
//The surgeon general warns that being buckled to certain objects receiving powerful shocks is greatly hazardous to your health
|
||||
//Only tesla coils and grounding rods currently call this because mobs are already targeted over all other objects, but this might be useful for more things later.
|
||||
/obj/proc/tesla_buckle_check(var/strength)
|
||||
//Only tesla coils, vehicles, and grounding rods currently call this because mobs are already targeted over all other objects, but this might be useful for more things later.
|
||||
/obj/proc/zap_buckle_check(var/strength)
|
||||
if(has_buckled_mobs())
|
||||
for(var/m in buckled_mobs)
|
||||
var/mob/living/buckled_mob = m
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
/obj/proc/updateUsrDialog()
|
||||
if((obj_flags & IN_USE) && !(obj_flags & USES_TGUI))
|
||||
var/is_in_use = FALSE
|
||||
var/list/nearby = get_actual_viewers(1, src)
|
||||
var/list/nearby = fov_viewers(1, src)
|
||||
for(var/mob/M in nearby)
|
||||
if ((M.client && M.machine == src))
|
||||
is_in_use = TRUE
|
||||
@@ -152,7 +152,7 @@
|
||||
if(obj_flags & IN_USE)
|
||||
var/is_in_use = FALSE
|
||||
if(update_viewers)
|
||||
for(var/mob/M in get_actual_viewers(1, src))
|
||||
for(var/mob/M in fov_viewers(1, src))
|
||||
if ((M.client && M.machine == src))
|
||||
is_in_use = TRUE
|
||||
src.interact(M)
|
||||
|
||||
@@ -35,101 +35,368 @@
|
||||
else
|
||||
painting = null
|
||||
|
||||
|
||||
//////////////
|
||||
// CANVASES //
|
||||
//////////////
|
||||
|
||||
#define AMT_OF_CANVASES 4 //Keep this up to date or shit will break.
|
||||
|
||||
//To safe memory on making /icons we cache the blanks..
|
||||
GLOBAL_LIST_INIT(globalBlankCanvases, new(AMT_OF_CANVASES))
|
||||
|
||||
/obj/item/canvas
|
||||
name = "canvas"
|
||||
desc = "Draw out your soul on this canvas!"
|
||||
icon = 'icons/obj/artstuff.dmi'
|
||||
icon_state = "11x11"
|
||||
resistance_flags = FLAMMABLE
|
||||
var/whichGlobalBackup = 1 //List index
|
||||
var/width = 11
|
||||
var/height = 11
|
||||
var/list/grid
|
||||
var/canvas_color = "#ffffff" //empty canvas color
|
||||
var/ui_x = 400
|
||||
var/ui_y = 400
|
||||
var/used = FALSE
|
||||
var/painting_name //Painting name, this is set after framing.
|
||||
var/finalized = FALSE //Blocks edits
|
||||
var/author_ckey
|
||||
var/icon_generated = FALSE
|
||||
var/icon/generated_icon
|
||||
|
||||
/obj/item/canvas/nineteenXnineteen
|
||||
icon_state = "19x19"
|
||||
whichGlobalBackup = 2
|
||||
// Painting overlay offset when framed
|
||||
var/framed_offset_x = 11
|
||||
var/framed_offset_y = 10
|
||||
|
||||
/obj/item/canvas/twentythreeXnineteen
|
||||
icon_state = "23x19"
|
||||
whichGlobalBackup = 3
|
||||
pixel_x = 10
|
||||
pixel_y = 9
|
||||
|
||||
/obj/item/canvas/twentythreeXtwentythree
|
||||
icon_state = "23x23"
|
||||
whichGlobalBackup = 4
|
||||
|
||||
//HEY YOU
|
||||
//ARE YOU READING THE CODE FOR CANVASES?
|
||||
//ARE YOU AWARE THEY CRASH HALF THE SERVER WHEN SOMEONE DRAWS ON THEM...
|
||||
//...AND NOBODY CAN FIGURE OUT WHY?
|
||||
//THEN GO ON BRAVE TRAVELER
|
||||
//TRY TO FIX THEM AND REMOVE THIS CODE
|
||||
/obj/item/canvas/Initialize()
|
||||
..()
|
||||
return INITIALIZE_HINT_QDEL //Delete on creation
|
||||
. = ..()
|
||||
reset_grid()
|
||||
|
||||
//Find the right size blank canvas
|
||||
/obj/item/canvas/proc/getGlobalBackup()
|
||||
. = null
|
||||
if(GLOB.globalBlankCanvases[whichGlobalBackup])
|
||||
. = GLOB.globalBlankCanvases[whichGlobalBackup]
|
||||
else
|
||||
var/icon/I = icon(initial(icon),initial(icon_state))
|
||||
GLOB.globalBlankCanvases[whichGlobalBackup] = I
|
||||
. = I
|
||||
/obj/item/canvas/proc/reset_grid()
|
||||
grid = new/list(width,height)
|
||||
for(var/x in 1 to width)
|
||||
for(var/y in 1 to height)
|
||||
grid[x][y] = canvas_color
|
||||
|
||||
/obj/item/canvas/attack_self(mob/user)
|
||||
. = ..()
|
||||
ui_interact(user)
|
||||
|
||||
/obj/item/canvas/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
|
||||
//One pixel increments
|
||||
/obj/item/canvas/attackby(obj/item/I, mob/user, params)
|
||||
//Click info
|
||||
var/list/click_params = params2list(params)
|
||||
var/pixX = text2num(click_params["icon-x"])
|
||||
var/pixY = text2num(click_params["icon-y"])
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "canvas", name, ui_x, ui_y, master_ui, state)
|
||||
ui.set_autoupdate(FALSE)
|
||||
ui.open()
|
||||
|
||||
//Should always be true, otherwise you didn't click the object, but let's check because SS13~
|
||||
if(!click_params || !click_params["icon-x"] || !click_params["icon-y"])
|
||||
return
|
||||
|
||||
//Cleaning one pixel with a soap or rag
|
||||
if(istype(I, /obj/item/soap) || istype(I, /obj/item/reagent_containers/rag))
|
||||
//Pixel info created only when needed
|
||||
var/icon/masterpiece = icon(icon,icon_state)
|
||||
var/thePix = masterpiece.GetPixel(pixX,pixY)
|
||||
var/icon/Ico = getGlobalBackup()
|
||||
if(!Ico)
|
||||
qdel(masterpiece)
|
||||
return
|
||||
|
||||
var/theOriginalPix = Ico.GetPixel(pixX,pixY)
|
||||
if(thePix != theOriginalPix) //colour changed
|
||||
DrawPixelOn(theOriginalPix,pixX,pixY)
|
||||
qdel(masterpiece)
|
||||
|
||||
//Drawing one pixel with a crayon
|
||||
else if(istype(I, /obj/item/toy/crayon))
|
||||
var/obj/item/toy/crayon/C = I
|
||||
DrawPixelOn(C.paint_color, pixX, pixY)
|
||||
/obj/item/canvas/attackby(obj/item/I, mob/living/user, params)
|
||||
if(user.a_intent == INTENT_HELP)
|
||||
ui_interact(user)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/canvas/ui_data(mob/user)
|
||||
. = ..()
|
||||
.["grid"] = grid
|
||||
.["name"] = painting_name
|
||||
.["finalized"] = finalized
|
||||
|
||||
//Clean the whole canvas
|
||||
/obj/item/canvas/attack_self(mob/user)
|
||||
if(!user)
|
||||
/obj/item/canvas/examine(mob/user)
|
||||
. = ..()
|
||||
ui_interact(user)
|
||||
|
||||
/obj/item/canvas/ui_act(action, params)
|
||||
. = ..()
|
||||
if(. || finalized)
|
||||
return
|
||||
var/icon/blank = getGlobalBackup()
|
||||
if(blank)
|
||||
//it's basically a giant etch-a-sketch
|
||||
icon = blank
|
||||
user.visible_message("<span class='notice'>[user] cleans the canvas.</span>","<span class='notice'>You clean the canvas.</span>")
|
||||
var/mob/user = usr
|
||||
switch(action)
|
||||
if("paint")
|
||||
var/obj/item/I = user.get_active_held_item()
|
||||
var/color = get_paint_tool_color(I)
|
||||
if(!color)
|
||||
return FALSE
|
||||
var/x = text2num(params["x"])
|
||||
var/y = text2num(params["y"])
|
||||
grid[x][y] = color
|
||||
used = TRUE
|
||||
update_icon()
|
||||
. = TRUE
|
||||
if("finalize")
|
||||
. = TRUE
|
||||
if(!finalized)
|
||||
finalize(user)
|
||||
|
||||
/obj/item/canvas/proc/finalize(mob/user)
|
||||
finalized = TRUE
|
||||
author_ckey = user.ckey
|
||||
generate_proper_overlay()
|
||||
try_rename(user)
|
||||
|
||||
/obj/item/canvas/update_overlays()
|
||||
. = ..()
|
||||
if(!icon_generated)
|
||||
if(used)
|
||||
var/mutable_appearance/detail = mutable_appearance(icon,"[icon_state]wip")
|
||||
detail.pixel_x = 1
|
||||
detail.pixel_y = 1
|
||||
. += detail
|
||||
else
|
||||
var/mutable_appearance/detail = mutable_appearance(generated_icon)
|
||||
detail.pixel_x = 1
|
||||
detail.pixel_y = 1
|
||||
. += detail
|
||||
|
||||
/obj/item/canvas/proc/generate_proper_overlay()
|
||||
if(icon_generated)
|
||||
return
|
||||
var/png_filename = "data/paintings/temp_painting.png"
|
||||
var/result = rustg_dmi_create_png(png_filename,"[width]","[height]",get_data_string())
|
||||
if(result)
|
||||
CRASH("Error generating painting png : [result]")
|
||||
generated_icon = new(png_filename)
|
||||
icon_generated = TRUE
|
||||
update_icon()
|
||||
|
||||
/obj/item/canvas/proc/get_data_string()
|
||||
var/list/data = list()
|
||||
for(var/y in 1 to height)
|
||||
for(var/x in 1 to width)
|
||||
data += grid[x][y]
|
||||
return data.Join("")
|
||||
|
||||
//Todo make this element ?
|
||||
/obj/item/canvas/proc/get_paint_tool_color(obj/item/I)
|
||||
if(!I)
|
||||
return
|
||||
if(istype(I, /obj/item/toy/crayon))
|
||||
var/obj/item/toy/crayon/C = I
|
||||
return C.paint_color
|
||||
else if(istype(I, /obj/item/pen))
|
||||
var/obj/item/pen/P = I
|
||||
switch(P.colour)
|
||||
if("black")
|
||||
return "#000000"
|
||||
if("blue")
|
||||
return "#0000ff"
|
||||
if("red")
|
||||
return "#ff0000"
|
||||
return P.colour
|
||||
else if(istype(I, /obj/item/soap) || istype(I, /obj/item/reagent_containers/rag))
|
||||
return canvas_color
|
||||
|
||||
/obj/item/canvas/proc/try_rename(mob/user)
|
||||
var/new_name = stripped_input(user,"What do you want to name the painting?")
|
||||
if(!painting_name && new_name && user.canUseTopic(src,BE_CLOSE))
|
||||
painting_name = new_name
|
||||
SStgui.update_uis(src)
|
||||
|
||||
/obj/item/canvas/nineteenXnineteen
|
||||
icon_state = "19x19"
|
||||
width = 19
|
||||
height = 19
|
||||
ui_x = 600
|
||||
ui_y = 600
|
||||
pixel_x = 6
|
||||
pixel_y = 9
|
||||
framed_offset_x = 8
|
||||
framed_offset_y = 9
|
||||
|
||||
/obj/item/canvas/twentythreeXnineteen
|
||||
icon_state = "23x19"
|
||||
width = 23
|
||||
height = 19
|
||||
ui_x = 800
|
||||
ui_y = 600
|
||||
pixel_x = 4
|
||||
pixel_y = 10
|
||||
framed_offset_x = 6
|
||||
framed_offset_y = 8
|
||||
|
||||
/obj/item/canvas/twentythreeXtwentythree
|
||||
icon_state = "23x23"
|
||||
width = 23
|
||||
height = 23
|
||||
ui_x = 800
|
||||
ui_y = 800
|
||||
pixel_x = 5
|
||||
pixel_y = 9
|
||||
framed_offset_x = 5
|
||||
framed_offset_y = 6
|
||||
|
||||
/obj/item/wallframe/painting
|
||||
name = "painting frame"
|
||||
desc = "The perfect showcase for your favorite deathtrap memories."
|
||||
icon = 'icons/obj/decals.dmi'
|
||||
custom_materials = null
|
||||
flags_1 = 0
|
||||
icon_state = "frame-empty"
|
||||
result_path = /obj/structure/sign/painting
|
||||
|
||||
/obj/structure/sign/painting
|
||||
name = "Painting"
|
||||
desc = "Art or \"Art\"? You decide."
|
||||
icon = 'icons/obj/decals.dmi'
|
||||
icon_state = "frame-empty"
|
||||
buildable_sign = FALSE
|
||||
var/obj/item/canvas/C
|
||||
var/persistence_id
|
||||
|
||||
/obj/structure/sign/painting/Initialize(mapload, dir, building)
|
||||
. = ..()
|
||||
SSpersistence.painting_frames += src
|
||||
AddComponent(/datum/component/art, 20)
|
||||
if(dir)
|
||||
setDir(dir)
|
||||
if(building)
|
||||
pixel_x = (dir & 3)? 0 : (dir == 4 ? -30 : 30)
|
||||
pixel_y = (dir & 3)? (dir ==1 ? -30 : 30) : 0
|
||||
|
||||
/obj/structure/sign/painting/Destroy()
|
||||
. = ..()
|
||||
SSpersistence.painting_frames -= src
|
||||
|
||||
/obj/structure/sign/painting/attackby(obj/item/I, mob/user, params)
|
||||
if(!C && istype(I, /obj/item/canvas))
|
||||
frame_canvas(user,I)
|
||||
else if(C && !C.painting_name && istype(I,/obj/item/pen))
|
||||
try_rename(user)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/structure/sign/painting/examine(mob/user)
|
||||
. = ..()
|
||||
if(C)
|
||||
C.ui_interact(user,state = GLOB.physical_obscured_state)
|
||||
|
||||
/obj/structure/sign/painting/wirecutter_act(mob/living/user, obj/item/I)
|
||||
. = ..()
|
||||
if(C)
|
||||
C.forceMove(drop_location())
|
||||
C = null
|
||||
to_chat(user, "<span class='notice'>You remove the painting from the frame.</span>")
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
/obj/structure/sign/painting/proc/frame_canvas(mob/user,obj/item/canvas/new_canvas)
|
||||
if(user.transferItemToLoc(new_canvas,src))
|
||||
C = new_canvas
|
||||
if(!C.finalized)
|
||||
C.finalize(user)
|
||||
to_chat(user,"<span class='notice'>You frame [C].</span>")
|
||||
update_icon()
|
||||
|
||||
/obj/structure/sign/painting/proc/try_rename(mob/user)
|
||||
if(!C.painting_name)
|
||||
C.try_rename(user)
|
||||
|
||||
/obj/structure/sign/painting/update_icon_state()
|
||||
. = ..()
|
||||
if(C && C.generated_icon)
|
||||
icon_state = null
|
||||
else
|
||||
icon_state = "frame-empty"
|
||||
|
||||
|
||||
#undef AMT_OF_CANVASES
|
||||
/obj/structure/sign/painting/update_overlays()
|
||||
. = ..()
|
||||
if(C && C.generated_icon)
|
||||
var/mutable_appearance/MA = mutable_appearance(C.generated_icon)
|
||||
MA.pixel_x = C.framed_offset_x
|
||||
MA.pixel_y = C.framed_offset_y
|
||||
. += MA
|
||||
var/mutable_appearance/frame = mutable_appearance(C.icon,"[C.icon_state]frame")
|
||||
frame.pixel_x = C.framed_offset_x - 1
|
||||
frame.pixel_y = C.framed_offset_y - 1
|
||||
. += frame
|
||||
|
||||
/obj/structure/sign/painting/proc/load_persistent()
|
||||
if(!persistence_id)
|
||||
return
|
||||
if(!SSpersistence.paintings || !SSpersistence.paintings[persistence_id] || !length(SSpersistence.paintings[persistence_id]))
|
||||
return
|
||||
var/list/chosen = pick(SSpersistence.paintings[persistence_id])
|
||||
var/title = chosen["title"]
|
||||
var/author = chosen["ckey"]
|
||||
var/png = "data/paintings/[persistence_id]/[chosen["md5"]].png"
|
||||
if(!fexists(png))
|
||||
stack_trace("Persistent painting [chosen["md5"]].png was not found in [persistence_id] directory.")
|
||||
return
|
||||
var/icon/I = new(png)
|
||||
var/obj/item/canvas/new_canvas
|
||||
var/w = I.Width()
|
||||
var/h = I.Height()
|
||||
for(var/T in typesof(/obj/item/canvas))
|
||||
new_canvas = T
|
||||
if(initial(new_canvas.width) == w && initial(new_canvas.height) == h)
|
||||
new_canvas = new T(src)
|
||||
break
|
||||
new_canvas.fill_grid_from_icon(I)
|
||||
new_canvas.generated_icon = I
|
||||
new_canvas.icon_generated = TRUE
|
||||
new_canvas.finalized = TRUE
|
||||
new_canvas.painting_name = title
|
||||
new_canvas.author_ckey = author
|
||||
C = new_canvas
|
||||
update_icon()
|
||||
|
||||
/obj/structure/sign/painting/proc/save_persistent()
|
||||
if(!persistence_id || !C)
|
||||
return
|
||||
if(sanitize_filename(persistence_id) != persistence_id)
|
||||
stack_trace("Invalid persistence_id - [persistence_id]")
|
||||
return
|
||||
var/data = C.get_data_string()
|
||||
var/md5 = md5(data)
|
||||
var/list/current = SSpersistence.paintings[persistence_id]
|
||||
if(!current)
|
||||
current = list()
|
||||
for(var/list/entry in current)
|
||||
if(entry["md5"] == md5)
|
||||
return
|
||||
var/png_directory = "data/paintings/[persistence_id]/"
|
||||
var/png_path = png_directory + "[md5].png"
|
||||
var/result = rustg_dmi_create_png(png_path,"[C.width]","[C.height]",data)
|
||||
if(result)
|
||||
CRASH("Error saving persistent painting: [result]")
|
||||
current += list(list("title" = C.painting_name , "md5" = md5, "ckey" = C.author_ckey))
|
||||
SSpersistence.paintings[persistence_id] = current
|
||||
|
||||
/obj/item/canvas/proc/fill_grid_from_icon(icon/I)
|
||||
var/h = I.Height() + 1
|
||||
for(var/x in 1 to width)
|
||||
for(var/y in 1 to height)
|
||||
grid[x][y] = I.GetPixel(x,h-y)
|
||||
|
||||
//Presets for art gallery mapping, for paintings to be shared across stations
|
||||
/obj/structure/sign/painting/library
|
||||
persistence_id = "library"
|
||||
|
||||
/obj/structure/sign/painting/library_secure
|
||||
persistence_id = "library_secure"
|
||||
|
||||
/obj/structure/sign/painting/library_private // keep your smut away from prying eyes, or non-librarians at least
|
||||
persistence_id = "library_private"
|
||||
|
||||
/obj/structure/sign/painting/vv_get_dropdown()
|
||||
. = ..()
|
||||
VV_DROPDOWN_OPTION(VV_HK_REMOVE_PAINTING, "Remove Persistent Painting")
|
||||
|
||||
/obj/structure/sign/painting/vv_do_topic(list/href_list)
|
||||
. = ..()
|
||||
if(href_list[VV_HK_REMOVE_PAINTING])
|
||||
if(!check_rights(NONE))
|
||||
return
|
||||
var/mob/user = usr
|
||||
if(!persistence_id || !C)
|
||||
to_chat(user,"<span class='warning'>This is not a persistent painting.</span>")
|
||||
return
|
||||
var/md5 = md5(C.get_data_string())
|
||||
var/author = C.author_ckey
|
||||
var/list/current = SSpersistence.paintings[persistence_id]
|
||||
if(current)
|
||||
for(var/list/entry in current)
|
||||
if(entry["md5"] == md5)
|
||||
current -= entry
|
||||
var/png = "data/paintings/[persistence_id]/[md5].png"
|
||||
fdel(png)
|
||||
for(var/obj/structure/sign/painting/P in SSpersistence.painting_frames)
|
||||
if(P.C && md5(P.C.get_data_string()) == md5)
|
||||
QDEL_NULL(P.C)
|
||||
log_admin("[key_name(user)] has deleted a persistent painting made by [author].")
|
||||
message_admins("<span class='notice'>[key_name_admin(user)] has deleted persistent painting made by [author].</span>")
|
||||
|
||||
@@ -108,7 +108,9 @@
|
||||
if(!istype(poordude))
|
||||
return TRUE
|
||||
user.visible_message("<span class='notice'>[user] pulls [src] out from under [poordude].</span>", "<span class='notice'>You pull [src] out from under [poordude].</span>")
|
||||
var/C = new item_chair(loc)
|
||||
var/obj/item/chair/C = new item_chair(loc)
|
||||
C.set_custom_materials(custom_materials)
|
||||
TransferComponents(C)
|
||||
user.put_in_hands(C)
|
||||
poordude.DefaultCombatKnockdown(20)//rip in peace
|
||||
user.adjustStaminaLoss(5)
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
Snake = L
|
||||
break
|
||||
if(Snake)
|
||||
alerted = get_actual_viewers(world.view,src)
|
||||
alerted = fov_viewers(world.view,src)
|
||||
..()
|
||||
if(LAZYLEN(alerted))
|
||||
egged = world.time + SNAKE_SPAM_TICKS
|
||||
|
||||
@@ -267,7 +267,7 @@
|
||||
var/obj/structure/cable/C = T.get_cable_node()
|
||||
if(C)
|
||||
playsound(src, 'sound/magic/lightningshock.ogg', 100, 1, extrarange = 5)
|
||||
tesla_zap(src, 3, C.newavail() * 0.01, TESLA_MOB_DAMAGE | TESLA_OBJ_DAMAGE | TESLA_MOB_STUN | TESLA_ALLOW_DUPLICATES) //Zap for 1/100 of the amount of power. At a million watts in the grid, it will be as powerful as a tesla revolver shot.
|
||||
tesla_zap(src, 3, C.newavail() * 0.01, ZAP_MOB_DAMAGE | ZAP_OBJ_DAMAGE | ZAP_MOB_STUN | ZAP_ALLOW_DUPLICATES) //Zap for 1/100 of the amount of power. At a million watts in the grid, it will be as powerful as a tesla revolver shot.
|
||||
C.add_delayedload(C.newavail() * 0.0375) // you can gain up to 3.5 via the 4x upgrades power is halved by the pole so thats 2x then 1X then .5X for 3.5x the 3 bounces shock.
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
// The crowd is pleased
|
||||
// The delay is to making large crowds have a longer laster applause
|
||||
var/delay_offset = 0
|
||||
for(var/mob/M in get_actual_viewers(world.view, src))
|
||||
for(var/mob/M in fov_viewers(world.view, src))
|
||||
var/mob/living/carbon/human/C = M
|
||||
if (ishuman(M))
|
||||
addtimer(CALLBACK(C, /mob/.proc/emote, "clap"), delay_offset * 0.3)
|
||||
|
||||
@@ -8,12 +8,11 @@
|
||||
max_integrity = 100
|
||||
var/oreAmount = 5
|
||||
var/material_drop_type = /obj/item/stack/sheet/metal
|
||||
var/impressiveness = 15
|
||||
CanAtmosPass = ATMOS_PASS_DENSITY
|
||||
|
||||
|
||||
/obj/structure/statue/attackby(obj/item/W, mob/living/user, params)
|
||||
add_fingerprint(user)
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
if(default_unfasten_wrench(user, W))
|
||||
return
|
||||
@@ -36,8 +35,22 @@
|
||||
return
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
add_fingerprint(user)
|
||||
user.visible_message("[user] rubs some dust off from the [name]'s surface.", \
|
||||
"<span class='notice'>You rub some dust off from the [name]'s surface.</span>")
|
||||
if(!do_after(user, 20, target = src))
|
||||
return
|
||||
user.visible_message("[user] rubs some dust off [src].", \
|
||||
"<span class='notice'>You take in [src], rubbing some dust off its surface.</span>")
|
||||
if(!ishuman(user)) // only humans have the capacity to appreciate art
|
||||
return
|
||||
var/totalimpressiveness = (impressiveness *(obj_integrity/max_integrity))
|
||||
switch(totalimpressiveness)
|
||||
if(GREAT_ART to 100)
|
||||
SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "artgreat", /datum/mood_event/artgreat)
|
||||
if (GOOD_ART to GREAT_ART)
|
||||
SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "artgood", /datum/mood_event/artgood)
|
||||
if (BAD_ART to GOOD_ART)
|
||||
SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "artok", /datum/mood_event/artok)
|
||||
if (0 to BAD_ART)
|
||||
SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "artbad", /datum/mood_event/artbad)
|
||||
|
||||
/obj/structure/statue/deconstruct(disassembled = TRUE)
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
@@ -58,6 +71,7 @@
|
||||
material_drop_type = /obj/item/stack/sheet/mineral/uranium
|
||||
var/last_event = 0
|
||||
var/active = null
|
||||
impressiveness = 25 // radiation makes an impression
|
||||
|
||||
/obj/structure/statue/uranium/nuke
|
||||
name = "statue of a nuclear fission explosive"
|
||||
@@ -101,6 +115,7 @@
|
||||
max_integrity = 200
|
||||
material_drop_type = /obj/item/stack/sheet/mineral/plasma
|
||||
desc = "This statue is suitably made from plasma."
|
||||
impressiveness = 20
|
||||
|
||||
/obj/structure/statue/plasma/scientist
|
||||
name = "statue of a scientist"
|
||||
@@ -151,6 +166,7 @@
|
||||
max_integrity = 300
|
||||
material_drop_type = /obj/item/stack/sheet/mineral/gold
|
||||
desc = "This is a highly valuable statue made from gold."
|
||||
impressiveness = 30
|
||||
|
||||
/obj/structure/statue/gold/hos
|
||||
name = "statue of the head of security"
|
||||
@@ -178,6 +194,7 @@
|
||||
max_integrity = 300
|
||||
material_drop_type = /obj/item/stack/sheet/mineral/silver
|
||||
desc = "This is a valuable statue made from silver."
|
||||
impressiveness = 25
|
||||
|
||||
/obj/structure/statue/silver/md
|
||||
name = "statue of a medical officer"
|
||||
@@ -205,6 +222,7 @@
|
||||
max_integrity = 1000
|
||||
material_drop_type = /obj/item/stack/sheet/mineral/diamond
|
||||
desc = "This is a very expensive diamond statue."
|
||||
impressiveness = 60
|
||||
|
||||
/obj/structure/statue/diamond/captain
|
||||
name = "statue of THE captain."
|
||||
@@ -225,6 +243,7 @@
|
||||
material_drop_type = /obj/item/stack/sheet/mineral/bananium
|
||||
desc = "A bananium statue with a small engraving:'HOOOOOOONK'."
|
||||
var/spam_flag = 0
|
||||
impressiveness = 65
|
||||
|
||||
/obj/structure/statue/bananium/clown
|
||||
name = "statue of a clown"
|
||||
|
||||
@@ -183,7 +183,7 @@
|
||||
|
||||
/obj/structure/table/alt_attack_hand(mob/user)
|
||||
if(user && Adjacent(user) && !user.incapacitated())
|
||||
user.setClickCooldown(4)
|
||||
user.changeNext_move(CLICK_CD_MELEE*0.5)
|
||||
if(istype(user) && user.a_intent == INTENT_HARM)
|
||||
user.visible_message("<span class='warning'>[user] slams [user.p_their()] palms down on [src].</span>", "<span class='warning'>You slam your palms down on [src].</span>")
|
||||
playsound(src, 'sound/weapons/sonic_jackhammer.ogg', 50, 1)
|
||||
|
||||
@@ -80,7 +80,10 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list(
|
||||
var/old_dynamic_lighting = dynamic_lighting
|
||||
var/old_affecting_lights = affecting_lights
|
||||
var/old_lighting_object = lighting_object
|
||||
var/old_corners = corners
|
||||
var/old_lc_topright = lc_topright
|
||||
var/old_lc_topleft = lc_topleft
|
||||
var/old_lc_bottomright = lc_bottomright
|
||||
var/old_lc_bottomleft = lc_bottomleft
|
||||
|
||||
var/old_exl = explosion_level
|
||||
var/old_exi = explosion_id
|
||||
@@ -119,7 +122,10 @@ GLOBAL_LIST_INIT(blacklisted_automated_baseturfs, typecacheof(list(
|
||||
recalc_atom_opacity()
|
||||
lighting_object = old_lighting_object
|
||||
affecting_lights = old_affecting_lights
|
||||
corners = old_corners
|
||||
lc_topright = old_lc_topright
|
||||
lc_topleft = old_lc_topleft
|
||||
lc_bottomright = old_lc_bottomright
|
||||
lc_bottomleft = old_lc_bottomleft
|
||||
if (old_opacity != opacity || dynamic_lighting != old_dynamic_lighting)
|
||||
reconsider_lights()
|
||||
|
||||
|
||||
@@ -290,7 +290,7 @@
|
||||
if(LAZYLEN(dent_decals) >= MAX_DENT_DECALS)
|
||||
return
|
||||
|
||||
var/mutable_appearance/decal = mutable_appearance('icons/effects/effects.dmi', "", BULLET_HOLE_LAYER)
|
||||
var/mutable_appearance/decal = mutable_appearance('icons/effects/effects.dmi', "", BULLET_HOLE_LAYER, ABOVE_WALL_PLANE)
|
||||
switch(denttype)
|
||||
if(WALL_DENT_SHOT)
|
||||
decal.icon_state = "bullet_hole"
|
||||
|
||||
+17
-3
@@ -1,6 +1,7 @@
|
||||
#define RESTART_COUNTER_PATH "data/round_counter.txt"
|
||||
|
||||
GLOBAL_VAR(restart_counter)
|
||||
GLOBAL_VAR_INIT(tgs_initialized, FALSE)
|
||||
|
||||
GLOBAL_VAR(topic_status_lastcache)
|
||||
GLOBAL_LIST(topic_status_cache)
|
||||
@@ -23,10 +24,11 @@ GLOBAL_LIST(topic_status_cache)
|
||||
|
||||
make_datum_references_lists() //initialises global lists for referencing frequently used datums (so that we only ever do it once)
|
||||
|
||||
TgsNew(minimum_required_security_level = TGS_SECURITY_TRUSTED)
|
||||
|
||||
GLOB.revdata = new
|
||||
|
||||
InitTgs()
|
||||
|
||||
config.Load(params[OVERRIDE_CONFIG_DIRECTORY_PARAMETER])
|
||||
|
||||
//SetupLogs depends on the RoundID, so lets check
|
||||
@@ -62,6 +64,15 @@ GLOBAL_LIST(topic_status_cache)
|
||||
if(TEST_RUN_PARAMETER in params)
|
||||
HandleTestRun()
|
||||
|
||||
/world/proc/InitTgs()
|
||||
TgsNew(new /datum/tgs_event_handler/impl, TGS_SECURITY_TRUSTED)
|
||||
GLOB.revdata.load_tgs_info()
|
||||
#ifdef USE_CUSTOM_ERROR_HANDLER
|
||||
if (TgsAvailable())
|
||||
world.log = file("[GLOB.log_directory]/dd.log") //not all runtimes trigger world/Error, so this is the only way to ensure we can see all of them.
|
||||
#endif
|
||||
GLOB.tgs_initialized = TRUE
|
||||
|
||||
/world/proc/HandleTestRun()
|
||||
//trigger things to run the whole process
|
||||
Master.sleep_offline_after_initializations = FALSE
|
||||
@@ -125,6 +136,7 @@ GLOBAL_LIST(topic_status_cache)
|
||||
GLOB.subsystem_log = "[GLOB.log_directory]/subsystem.log"
|
||||
GLOB.reagent_log = "[GLOB.log_directory]/reagents.log"
|
||||
GLOB.world_crafting_log = "[GLOB.log_directory]/crafting.log"
|
||||
GLOB.click_log = "[GLOB.log_directory]/click.log"
|
||||
|
||||
|
||||
#ifdef UNIT_TESTS
|
||||
@@ -144,6 +156,7 @@ GLOBAL_LIST(topic_status_cache)
|
||||
start_log(GLOB.subsystem_log)
|
||||
start_log(GLOB.reagent_log)
|
||||
start_log(GLOB.world_crafting_log)
|
||||
start_log(GLOB.click_log)
|
||||
|
||||
GLOB.changelog_hash = md5('html/changelog.html') //for telling if the changelog has changed recently
|
||||
if(fexists(GLOB.config_error_log))
|
||||
@@ -223,16 +236,17 @@ GLOBAL_LIST(topic_status_cache)
|
||||
qdel(src) //shut it down
|
||||
|
||||
/world/Reboot(reason = 0, fast_track = FALSE)
|
||||
TgsReboot()
|
||||
if (reason || fast_track) //special reboot, do none of the normal stuff
|
||||
if (usr)
|
||||
log_admin("[key_name(usr)] Has requested an immediate world restart via client side debugging tools")
|
||||
message_admins("[key_name_admin(usr)] Has requested an immediate world restart via client side debugging tools")
|
||||
to_chat(world, "<span class='boldannounce'>Rebooting World immediately due to host request</span>")
|
||||
to_chat(world, "<span class='boldannounce'>Rebooting World immediately due to host request.</span>")
|
||||
else
|
||||
to_chat(world, "<span class='boldannounce'>Rebooting world...</span>")
|
||||
Master.Shutdown() //run SS shutdowns
|
||||
|
||||
TgsReboot()
|
||||
|
||||
if(TEST_RUN_PARAMETER in params)
|
||||
FinishTestRun()
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user