Merge branch 'master' into upstream-merge-33055

This commit is contained in:
LetterJay
2017-12-25 04:10:34 -06:00
committed by GitHub
687 changed files with 9555 additions and 5558 deletions
+2 -3
View File
@@ -26,9 +26,8 @@
aSignal = new(src)
aSignal.name = "[name] core"
aSignal.code = rand(1,100)
aSignal.frequency = rand(1200, 1599)
if(IsMultiple(aSignal.frequency, 2))//signaller frequencies are always uneven!
aSignal.frequency = rand(MIN_FREE_FREQ, MAX_FREE_FREQ)
if(ISMULTIPLE(aSignal.frequency, 2))//signaller frequencies are always uneven!
aSignal.frequency++
if(new_lifespan)
@@ -47,10 +47,8 @@
return
else
var/hotness = W.is_hot()
var/added_heat = (hotness / 100)
src.reagents.chem_temp = min(src.reagents.chem_temp + added_heat, hotness)
src.reagents.handle_reactions()
to_chat(user, "<span class='notice'>You heat [src] with [W]!</span>")
reagents.expose_temperature(hotness)
to_chat(user, "<span class='notice'>You heat [name] with [W]!</span>")
else
return ..()
@@ -62,8 +60,7 @@
/obj/effect/decal/cleanable/fire_act(exposed_temperature, exposed_volume)
if(reagents)
reagents.chem_temp += 30
reagents.handle_reactions()
reagents.expose_temperature(exposed_temperature)
..()
@@ -169,7 +169,7 @@
qdel(H)
var/list/G_gases = G.gases
if(G_gases[/datum/gas/plasma])
ASSERT_GAS(/datum/gas/nitrogen, G)
G.assert_gas(/datum/gas/nitrogen)
G_gases[/datum/gas/nitrogen][MOLES] += (G_gases[/datum/gas/plasma][MOLES])
G_gases[/datum/gas/plasma][MOLES] = 0
G.garbage_collect()
+42 -9
View File
@@ -16,7 +16,7 @@
/obj/effect/landmark/start
name = "start"
icon = 'icons/mob/screen_gen.dmi'
icon = 'icons/mob/landmarks.dmi'
icon_state = "x"
anchored = TRUE
var/jobspawn_override = FALSE
@@ -40,9 +40,9 @@
// START LANDMARKS FOLLOW. Don't change the names unless
// you are refactoring shitty landmark code.
/obj/effect/landmark/start/assistant
name = "Assistant"
icon_state = "Assistant"
/obj/effect/landmark/start/assistant/override
jobspawn_override = TRUE
@@ -50,102 +50,135 @@
/obj/effect/landmark/start/janitor
name = "Janitor"
icon_state = "Janitor"
/obj/effect/landmark/start/cargo_technician
name = "Cargo Technician"
icon_state = "Cargo Technician"
/obj/effect/landmark/start/bartender
name = "Bartender"
icon_state = "Bartender"
/obj/effect/landmark/start/clown
name = "Clown"
icon_state = "Clown"
/obj/effect/landmark/start/mime
name = "Mime"
icon_state = "Mime"
/obj/effect/landmark/start/quartermaster
name = "Quartermaster"
icon_state = "Quartermaster"
/obj/effect/landmark/start/atmospheric_technician
name = "Atmospheric Technician"
icon_state = "Atmospheric Technician"
/obj/effect/landmark/start/cook
name = "Cook"
icon_state = "Cook"
/obj/effect/landmark/start/shaft_miner
name = "Shaft Miner"
icon_state = "Shaft Miner"
/obj/effect/landmark/start/security_officer
name = "Security Officer"
icon_state = "Security Officer"
/obj/effect/landmark/start/botanist
name = "Botanist"
icon_state = "Botanist"
/obj/effect/landmark/start/head_of_security
name = "Head of Security"
/obj/effect/landmark/start/ai
name = "AI"
delete_after_roundstart = FALSE
icon_state = "Head of Security"
/obj/effect/landmark/start/captain
name = "Captain"
icon_state = "Captain"
/obj/effect/landmark/start/detective
name = "Detective"
icon_state = "Detective"
/obj/effect/landmark/start/warden
name = "Warden"
icon_state = "Warden"
/obj/effect/landmark/start/chief_engineer
name = "Chief Engineer"
/obj/effect/landmark/start/cyborg
name = "Cyborg"
icon_state = "Chief Engineer"
/obj/effect/landmark/start/head_of_personnel
name = "Head of Personnel"
icon_state = "Head of Personnel"
/obj/effect/landmark/start/librarian
name = "Curator"
icon_state = "Curator"
/obj/effect/landmark/start/lawyer
name = "Lawyer"
icon_state = "Lawyer"
/obj/effect/landmark/start/station_engineer
name = "Station Engineer"
icon_state = "Station Engineer"
/obj/effect/landmark/start/medical_doctor
name = "Medical Doctor"
icon_state = "Medical Doctor"
/obj/effect/landmark/start/scientist
name = "Scientist"
icon_state = "Scientist"
/obj/effect/landmark/start/chemist
name = "Chemist"
icon_state = "Chemist"
/obj/effect/landmark/start/roboticist
name = "Roboticist"
icon_state = "Roboticist"
/obj/effect/landmark/start/research_director
name = "Research Director"
icon_state = "Research Director"
/obj/effect/landmark/start/geneticist
name = "Geneticist"
icon_state = "Geneticist"
/obj/effect/landmark/start/chief_medical_officer
name = "Chief Medical Officer"
icon_state = "Chief Medical Officer"
/obj/effect/landmark/start/virologist
name = "Virologist"
icon_state = "Virologist"
/obj/effect/landmark/start/chaplain
name = "Chaplain"
icon_state = "Chaplain"
/obj/effect/landmark/start/cyborg
name = "Cyborg"
icon_state = "Cyborg"
/obj/effect/landmark/start/ai
name = "AI"
icon_state = "AI"
delete_after_roundstart = FALSE
//Department Security spawns
/obj/effect/landmark/start/depsec
name = "department_sec"
icon_state = "Security Officer"
/obj/effect/landmark/start/depsec/New()
..()
+4 -1
View File
@@ -286,7 +286,6 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
if(!user.put_in_active_hand(src))
dropped(user)
/obj/item/attack_paw(mob/user)
if(!user)
return
@@ -400,12 +399,14 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
return ITALICS | REDUCE_RANGE
/obj/item/proc/dropped(mob/user)
SendSignal(COMSIG_ITEM_DROPPED, user)
for(var/X in actions)
var/datum/action/A = X
A.Remove(user)
if(DROPDEL_1 & flags_1)
qdel(src)
in_inventory = FALSE
SendSignal(COMSIG_ITEM_DROPPED,user)
// called just as an item is picked up (loc is not yet changed)
/obj/item/proc/pickup(mob/user)
@@ -431,10 +432,12 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
// for items that can be placed in multiple slots
// note this isn't called during the initial dressing of a player
/obj/item/proc/equipped(mob/user, slot)
SendSignal(COMSIG_ITEM_EQUIPPED, user, slot)
for(var/X in actions)
var/datum/action/A = X
if(item_action_slot_check(slot, user)) //some items only give their actions buttons when in a specific slot.
A.Grant(user)
SendSignal(COMSIG_ITEM_EQUIPPED,user,slot)
in_inventory = TRUE
//sometimes we only want to grant the item's action if it's equipped in a specific slot.
+5
View File
@@ -155,6 +155,11 @@ update_label("John Doe", "Clowny")
name = "agent card"
access = list(ACCESS_MAINT_TUNNELS, ACCESS_SYNDICATE)
var/anyone = FALSE //Can anyone forge the ID or just syndicate?
/obj/item/card/id/syndicate/nuke_leader
name = "lead agent card"
access = list(ACCESS_MAINT_TUNNELS, ACCESS_SYNDICATE, ACCESS_SYNDICATE_LEADER)
/obj/item/card/id/syndicate/Initialize()
. = ..()
+1 -1
View File
@@ -187,7 +187,7 @@
/obj/effect/chrono_field/update_icon()
var/ttk_frame = 1 - (tickstokill / initial(tickstokill))
ttk_frame = Clamp(Ceiling(ttk_frame * CHRONO_FRAME_COUNT), 1, CHRONO_FRAME_COUNT)
ttk_frame = CLAMP(CEILING(ttk_frame * CHRONO_FRAME_COUNT, 1), 1, CHRONO_FRAME_COUNT)
if(ttk_frame != RPpos)
RPpos = ttk_frame
mob_underlay.icon_state = "frame[RPpos]"
+3 -2
View File
@@ -102,7 +102,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
icon_state = "cigoff"
throw_speed = 0.5
item_state = "cigoff"
container_type = INJECTABLE_1
container_type = INJECTABLE
w_class = WEIGHT_CLASS_TINY
body_parts_covered = null
grind_results = list()
@@ -129,6 +129,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
reagents.add_reagent_list(list_reagents)
if(starts_lit)
light()
AddComponent(/datum/component/knockoff,90,list("mouth"),list(slot_wear_mask))//90% to knock off when wearing a mask
/obj/item/clothing/mask/cigarette/Destroy()
STOP_PROCESSING(SSobj, src)
@@ -659,7 +660,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
item_state = "[param_color]_vape"
/obj/item/clothing/mask/vape/attackby(obj/item/O, mob/user, params)
if(istype(O, /obj/item/reagent_containers) && (O.container_type & OPENCONTAINER_1))
if(O.is_drainable())
if(reagents.total_volume < chem_volume)
if(O.reagents.total_volume > 0)
O.reagents.trans_to(src,25)
+1 -1
View File
@@ -69,7 +69,7 @@
if(powered) //so it doesn't show charge if it's unpowered
if(cell)
var/ratio = cell.charge / cell.maxcharge
ratio = Ceiling(ratio*4) * 25
ratio = CEILING(ratio*4, 1) * 25
add_overlay("[initial(icon_state)]-charge[ratio]")
/obj/item/defibrillator/CheckParts(list/parts_list)
+2 -2
View File
@@ -180,9 +180,9 @@
/obj/item/cartridge/captain
name = "\improper Value-PAK cartridge"
desc = "Now with 350% more value!" //Give the Captain...EVERYTHING! (Except Mime and Clown)
desc = "Now with 350% more value!" //Give the Captain...EVERYTHING! (Except Mime, Clown, and Syndie)
icon_state = "cart-c"
access = ~(CART_CLOWN | CART_MIME)
access = ~(CART_CLOWN | CART_MIME | CART_REMOTE_DOOR)
bot_access_flags = SEC_BOT | MULE_BOT | FLOOR_BOT | CLEAN_BOT | MED_BOT
spam_enabled = 1
@@ -169,7 +169,7 @@
// Negative numbers will subtract
/obj/item/device/lightreplacer/proc/AddUses(amount = 1)
uses = Clamp(uses + amount, 0, max_uses)
uses = CLAMP(uses + amount, 0, max_uses)
/obj/item/device/lightreplacer/proc/AddShards(amount = 1, user)
bulb_shards += amount
@@ -228,7 +228,7 @@ effective or pretty fucking useless.
charge = max(0,charge - 25)//Quick decrease in light
else
charge = min(max_charge,charge + 50) //Charge in the dark
animate(user,alpha = Clamp(255 - charge,0,255),time = 10)
animate(user,alpha = CLAMP(255 - charge,0,255),time = 10)
/obj/item/device/jammer
+1 -1
View File
@@ -166,7 +166,7 @@
/obj/item/dice/proc/diceroll(mob/user)
result = rand(1, sides)
if(rigged && result != rigged)
if(prob(Clamp(1/(sides - 1) * 100, 25, 80)))
if(prob(CLAMP(1/(sides - 1) * 100, 25, 80)))
result = rigged
var/fake_result = rand(1, sides)//Daredevil isn't as good as he used to be
var/comment = ""
+3 -4
View File
@@ -16,6 +16,7 @@
attack_verb = list("slammed", "whacked", "bashed", "thunked", "battered", "bludgeoned", "thrashed")
dog_fashion = /datum/dog_fashion/back
resistance_flags = FIRE_PROOF
container_type = AMOUNT_VISIBLE
var/max_water = 50
var/last_use = 1
var/safety = TRUE
@@ -48,7 +49,6 @@
/obj/item/extinguisher/attack_self(mob/user)
safety = !safety
src.icon_state = "[sprite_name][!safety]"
src.desc = "The safety is [safety ? "on" : "off"]."
to_chat(user, "The safety is [safety ? "on" : "off"].")
return
@@ -67,11 +67,10 @@
/obj/item/extinguisher/examine(mob/user)
..()
to_chat(user, "The safety is [safety ? "on" : "off"].")
if(reagents.total_volume)
to_chat(user, "It contains [round(reagents.total_volume)] unit\s.")
to_chat(user, "<span class='notice'>Alt-click to empty it.</span>")
else
to_chat(user, "It is empty.")
/obj/item/extinguisher/proc/AttemptRefill(atom/target, mob/user)
if(istype(target, /obj/structure/reagent_dispensers/watertank) && target.Adjacent(user))
+28 -6
View File
@@ -7,6 +7,9 @@
/*
* Gifts
*/
GLOBAL_LIST_EMPTY(possible_gifts)
/obj/item/a_gift
name = "gift"
desc = "PRESENTS!!!! eek!"
@@ -30,6 +33,14 @@
to_chat(M, "<span class='warning'>You're supposed to be spreading gifts, not opening them yourself!</span>")
return
var/gift_type = get_gift_type()
qdel(src)
var/obj/item/I = new gift_type(M)
M.put_in_hands(I)
I.add_fingerprint(M)
/obj/item/a_gift/proc/get_gift_type()
var/gift_type_list = list(/obj/item/sord,
/obj/item/storage/wallet,
/obj/item/storage/photo_album,
@@ -72,10 +83,21 @@
var/gift_type = pick(gift_type_list)
if(!ispath(gift_type, /obj/item))
return
return gift_type
qdel(src)
var/obj/item/I = new gift_type(M)
M.put_in_hands(I)
I.add_fingerprint(M)
/obj/item/a_gift/anything
name = "christmas gift"
desc = "It could be anything!"
/obj/item/a_gift/anything/get_gift_type()
if(!GLOB.possible_gifts.len)
var/list/gift_types_list = subtypesof(/obj/item)
for(var/V in gift_types_list)
var/obj/item/I = V
if((!initial(I.icon_state)) || (!initial(I.item_state)) || (initial(I.flags_1) & ABSTRACT_1))
gift_types_list -= V
GLOB.possible_gifts = gift_types_list
var/gift_type = pick(GLOB.possible_gifts)
return gift_type
+2 -2
View File
@@ -87,7 +87,7 @@
return
var/newtime = input(usr, "Please set the timer.", "Timer", 10) as num
if(user.get_active_held_item() == src)
newtime = Clamp(newtime, 10, 60000)
newtime = CLAMP(newtime, 10, 60000)
det_time = newtime
to_chat(user, "Timer set for [det_time] seconds.")
@@ -204,7 +204,7 @@
/obj/item/grenade/plastic/c4/attack_self(mob/user)
var/newtime = input(usr, "Please set the timer.", "Timer", 10) as num
if(user.get_active_held_item() == src)
newtime = Clamp(newtime, 10, 60000)
newtime = CLAMP(newtime, 10, 60000)
timer = newtime
to_chat(user, "Timer set for [timer] seconds.")
+3 -3
View File
@@ -75,7 +75,7 @@
drowse()
return
if(bloodthirst < HIS_GRACE_CONSUME_OWNER)
adjust_bloodthirst(1 + Floor(LAZYLEN(contents) * 0.5)) //Maybe adjust this?
adjust_bloodthirst(1 + FLOOR(LAZYLEN(contents) * 0.5, 1)) //Maybe adjust this?
else
adjust_bloodthirst(1) //don't cool off rapidly once we're at the point where His Grace consumes all.
var/mob/living/master = get_atom_on_turf(src, /mob/living)
@@ -164,9 +164,9 @@
/obj/item/his_grace/proc/adjust_bloodthirst(amt)
prev_bloodthirst = bloodthirst
if(prev_bloodthirst < HIS_GRACE_CONSUME_OWNER)
bloodthirst = Clamp(bloodthirst + amt, HIS_GRACE_SATIATED, HIS_GRACE_CONSUME_OWNER)
bloodthirst = CLAMP(bloodthirst + amt, HIS_GRACE_SATIATED, HIS_GRACE_CONSUME_OWNER)
else
bloodthirst = Clamp(bloodthirst + amt, HIS_GRACE_CONSUME_OWNER, HIS_GRACE_FALL_ASLEEP)
bloodthirst = CLAMP(bloodthirst + amt, HIS_GRACE_CONSUME_OWNER, HIS_GRACE_FALL_ASLEEP)
update_stats()
/obj/item/his_grace/proc/update_stats()
@@ -14,6 +14,9 @@
/obj/item/implant/proc/trigger(emote, mob/living/carbon/source)
return
/obj/item/implant/proc/on_death(emote, mob/living/carbon/source)
return
/obj/item/implant/proc/activate()
return
@@ -2,7 +2,7 @@
name = "chem implant"
desc = "Injects things."
icon_state = "reagents"
container_type = OPENCONTAINER_1
container_type = OPENCONTAINER
/obj/item/implant/chem/get_data()
var/dat = {"<b>Implant Specifications:</b><BR>
@@ -3,7 +3,7 @@
desc = "And boom goes the weasel."
icon_state = "explosive"
actions_types = list(/datum/action/item_action/explosive_implant)
// Explosive implant action is always availible.
// Explosive implant action is always available.
var/weak = 2
var/medium = 0.8
var/heavy = 0.4
@@ -11,6 +11,9 @@
var/popup = FALSE // is the DOUWANNABLOWUP window open?
var/active = FALSE
/obj/item/implant/explosive/on_mob_death(mob/living/L, gibbed)
activate("death")
/obj/item/implant/explosive/get_data()
var/dat = {"<b>Implant Specifications:</b><BR>
<b>Name:</b> Robust Corp RX-78 Employee Management Implant<BR>
@@ -23,10 +26,6 @@
"}
return dat
/obj/item/implant/explosive/trigger(emote, mob/source)
if(emote == "deathgasp")
activate("death")
/obj/item/implant/explosive/activate(cause)
if(!cause || !imp_in || active)
return 0
+2 -2
View File
@@ -198,8 +198,8 @@
return target
var/x_o = (target.x - starting.x)
var/y_o = (target.y - starting.y)
var/new_x = Clamp((starting.x + (x_o * range_multiplier)), 0, world.maxx)
var/new_y = Clamp((starting.y + (y_o * range_multiplier)), 0, world.maxy)
var/new_x = CLAMP((starting.x + (x_o * range_multiplier)), 0, world.maxx)
var/new_y = CLAMP((starting.y + (y_o * range_multiplier)), 0, world.maxy)
var/turf/newtarget = locate(new_x, new_y, starting.z)
return newtarget
+38 -17
View File
@@ -33,7 +33,7 @@
add_logs(user, M, "stunned", src, "(INTENT: [uppertext(user.a_intent)])")
/obj/item/borg/cyborghug
name = "Hugging Module"
name = "hugging module"
icon_state = "hugmodule"
desc = "For when a someone really needs a hug."
var/mode = 0 //0 = Hugs 1 = "Hug" 2 = Shock 3 = CRUSH
@@ -336,6 +336,10 @@
cooldown = world.time + 600
log_game("[user.ckey]([user]) used an emagged Cyborg Harm Alarm in ([user.x],[user.y],[user.z])")
#define DISPENSE_LOLLIPOP_MODE 1
#define THROW_LOLLIPOP_MODE 2
#define THROW_GUMBALL_MODE 3
/obj/item/borg/lollipop
name = "lollipop fabricator"
desc = "Reward good humans with this. Toggle in-module to switch between dispensing and high velocity ejection modes."
@@ -343,8 +347,9 @@
var/candy = 30
var/candymax = 30
var/charge_delay = 10
var/charging = 0
var/mode = 1
var/charging = FALSE
var/mode = DISPENSE_LOLLIPOP_MODE
var/firedelay = 0
var/hitspeed = 2
var/hitdamage = 0
@@ -379,10 +384,22 @@
var/obj/O = A
if(O.density)
return FALSE
new /obj/item/reagent_containers/food/snacks/lollipop(T)
var/obj/item/reagent_containers/food/snacks/lollipop/L = new(T)
var/into_hands = FALSE
if(ismob(A))
var/mob/M = A
into_hands = M.put_in_hands(L)
candy--
check_amount()
to_chat(user, "<span class='notice'>Dispensing lollipop...</span>")
if(into_hands)
user.visible_message("<span class='notice'>[user] dispenses a lollipop into the hands of [A].</span>", "<span class='notice'>You dispense a lollipop into the hands of [A].</span>", "<span class='italics'>You hear a click.</span>")
else
user.visible_message("<span class='notice'>[user] dispenses a lollipop.</span>", "<span class='notice'>You dispense a lollipop.</span>", "<span class='italics'>You hear a click.</span>")
playsound(src.loc, 'sound/machines/click.ogg', 50, 1)
return TRUE
@@ -427,29 +444,33 @@
if(R.emagged)
hitdamage = emaggedhitdamage
switch(mode)
if(1)
if(DISPENSE_LOLLIPOP_MODE)
if(!proximity)
return FALSE
dispense(target, user)
if(2)
if(THROW_LOLLIPOP_MODE)
shootL(target, user, click_params)
if(3)
if(THROW_GUMBALL_MODE)
shootG(target, user, click_params)
hitdamage = initial(hitdamage)
/obj/item/borg/lollipop/attack_self(mob/living/user)
switch(mode)
if(1)
mode++
if(DISPENSE_LOLLIPOP_MODE)
mode = THROW_LOLLIPOP_MODE
to_chat(user, "<span class='notice'>Module is now throwing lollipops.</span>")
if(2)
mode++
if(THROW_LOLLIPOP_MODE)
mode = THROW_GUMBALL_MODE
to_chat(user, "<span class='notice'>Module is now blasting gumballs.</span>")
if(3)
mode = 1
if(THROW_GUMBALL_MODE)
mode = DISPENSE_LOLLIPOP_MODE
to_chat(user, "<span class='notice'>Module is now dispensing lollipops.</span>")
..()
#undef DISPENSE_LOLLIPOP_MODE
#undef THROW_LOLLIPOP_MODE
#undef THROW_GUMBALL_MODE
/obj/item/ammo_casing/caseless/gumball
name = "Gumball"
desc = "Why are you seeing this?!"
@@ -616,7 +637,7 @@
continue
usage += projectile_tick_speed_ecost
usage += (tracked[I] * projectile_damage_tick_ecost_coefficient)
energy = Clamp(energy - usage, 0, maxenergy)
energy = CLAMP(energy - usage, 0, maxenergy)
if(energy <= 0)
deactivate_field()
visible_message("<span class='warning'>[src] blinks \"ENERGY DEPLETED\".</span>")
@@ -626,7 +647,7 @@
if(iscyborg(host.loc))
host = host.loc
else
energy = Clamp(energy + energy_recharge, 0, maxenergy)
energy = CLAMP(energy + energy_recharge, 0, maxenergy)
return
if((host.cell.charge >= (host.cell.maxcharge * cyborg_cell_critical_percentage)) && (energy < maxenergy))
host.cell.use(energy_recharge*energy_recharge_cyborg_drain_coefficient)
@@ -655,7 +676,7 @@
/obj/item/borg/sight/xray
name = "\proper x-ray Vision"
name = "\proper x-ray vision"
icon = 'icons/obj/decals.dmi'
icon_state = "securearea"
sight_mode = BORGXRAY
+3 -3
View File
@@ -35,14 +35,14 @@
if(TH.force_wielded > initial(TH.force_wielded))
to_chat(user, "<span class='warning'>[TH] has already been refined before. It cannot be sharpened further!</span>")
return
TH.force_wielded = Clamp(TH.force_wielded + increment, 0, max)//wieldforce is increased since normal force wont stay
TH.force_wielded = CLAMP(TH.force_wielded + increment, 0, max)//wieldforce is increased since normal force wont stay
if(I.force > initial(I.force))
to_chat(user, "<span class='warning'>[I] has already been refined before. It cannot be sharpened further!</span>")
return
user.visible_message("<span class='notice'>[user] sharpens [I] with [src]!</span>", "<span class='notice'>You sharpen [I], making it much more deadly than before.</span>")
I.sharpness = IS_SHARP_ACCURATE
I.force = Clamp(I.force + increment, 0, max)
I.throwforce = Clamp(I.throwforce + increment, 0, max)
I.force = CLAMP(I.force + increment, 0, max)
I.throwforce = CLAMP(I.throwforce + increment, 0, max)
I.name = "[prefix] [I.name]"
name = "worn out [name]"
desc = "[desc] At least, it used to."
+5 -5
View File
@@ -48,9 +48,9 @@
/obj/item/stack/proc/update_weight()
if(amount <= (max_amount * (1/3)))
w_class = Clamp(full_w_class-2, WEIGHT_CLASS_TINY, full_w_class)
w_class = CLAMP(full_w_class-2, WEIGHT_CLASS_TINY, full_w_class)
else if (amount <= (max_amount * (2/3)))
w_class = Clamp(full_w_class-1, WEIGHT_CLASS_TINY, full_w_class)
w_class = CLAMP(full_w_class-1, WEIGHT_CLASS_TINY, full_w_class)
else
w_class = full_w_class
@@ -109,7 +109,7 @@
if (recipes_sublist && recipe_list[recipes_sublist] && istype(recipe_list[recipes_sublist], /datum/stack_recipe_list))
var/datum/stack_recipe_list/srl = recipe_list[recipes_sublist]
recipe_list = srl.recipes
var/t1 = "Amount Left: [amount]<br>"
var/t1 = "Amount Left: [get_amount()]<br>"
for(var/i in 1 to length(recipe_list))
var/E = recipe_list[i]
if (isnull(E))
@@ -161,8 +161,8 @@
if (href_list["sublist"] && !href_list["make"])
interact(usr, text2num(href_list["sublist"]))
if (href_list["make"])
if (get_amount() < 1)
qdel(src) //Never should happen
if (get_amount() < 1 && !is_cyborg)
qdel(src)
var/list/recipes_list = recipes
if (href_list["sublist"])
+1 -1
View File
@@ -419,7 +419,7 @@
name = "suspicious looking duffel bag"
desc = "A large duffel bag for holding extra tactical supplies."
icon_state = "duffel-syndie"
item_state = "duffel-syndie"
item_state = "duffel-syndieammo"
silent = 1
slowdown = 0
+1 -1
View File
@@ -17,7 +17,7 @@
/obj/item/tank/jetpack/New()
..()
if(gas_type)
ASSERT_GAS(gas_type,air_contents)
air_contents.assert_gas(gas_type)
air_contents.gases[gas_type][MOLES] = (6 * ONE_ATMOSPHERE) * volume / (R_IDEAL_GAS_EQUATION * T20C)
ion_trail = new
+4 -4
View File
@@ -21,7 +21,7 @@
/obj/item/tank/internals/oxygen/New()
..()
ASSERT_GAS(/datum/gas/oxygen, air_contents)
air_contents.assert_gas(/datum/gas/oxygen)
air_contents.gases[/datum/gas/oxygen][MOLES] = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
return
@@ -87,7 +87,7 @@
/obj/item/tank/internals/plasma/New()
..()
ASSERT_GAS(/datum/gas/plasma, air_contents)
air_contents.assert_gas(/datum/gas/plasma)
air_contents.gases[/datum/gas/plasma][MOLES] = (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
return
@@ -124,7 +124,7 @@
/obj/item/tank/internals/plasmaman/New()
..()
ASSERT_GAS(/datum/gas/plasma, air_contents)
air_contents.assert_gas(/datum/gas/plasma)
air_contents.gases[/datum/gas/plasma][MOLES] = (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
return
@@ -166,7 +166,7 @@
/obj/item/tank/internals/emergency_oxygen/New()
..()
ASSERT_GAS(/datum/gas/oxygen, air_contents)
air_contents.assert_gas(/datum/gas/oxygen)
air_contents.gases[/datum/gas/oxygen][MOLES] = (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
return
+1 -1
View File
@@ -194,7 +194,7 @@
pressure = text2num(pressure)
. = TRUE
if(.)
distribute_pressure = Clamp(round(pressure), TANK_MIN_RELEASE_PRESSURE, TANK_MAX_RELEASE_PRESSURE)
distribute_pressure = CLAMP(round(pressure), TANK_MIN_RELEASE_PRESSURE, TANK_MAX_RELEASE_PRESSURE)
/obj/item/tank/remove_air(amount)
return air_contents.remove(amount)
+2 -2
View File
@@ -114,7 +114,7 @@
possible_transfer_amounts = list(25,50,100)
volume = 500
flags_1 = NOBLUDGEON_1
container_type = OPENCONTAINER_1
container_type = OPENCONTAINER
slot_flags = 0
var/obj/item/watertank/tank
@@ -351,7 +351,7 @@
var/usage_ratio = 5 //5 unit added per 1 removed
var/injection_amount = 1
amount_per_transfer_from_this = 5
container_type = OPENCONTAINER_1
container_type = OPENCONTAINER
spillable = FALSE
possible_transfer_amounts = list(5,10,15)
+26 -20
View File
@@ -21,7 +21,7 @@
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 100, acid = 30)
resistance_flags = FIRE_PROOF
materials = list(MAT_METAL=70, MAT_GLASS=30)
materials = list(MAT_METAL=70, MAT_GLASS=30)
var/welding = 0 //Whether or not the welding tool is off(0), on(1) or currently welding(2)
var/status = TRUE //Whether the welder is secured or unsecured (able to attach rods to it to make a flamethrower)
var/max_fuel = 20 //The max amount of fuel the welder can hold
@@ -51,7 +51,7 @@
cut_overlays()
if(change_icons)
var/ratio = get_fuel() / max_fuel
ratio = Ceiling(ratio*4) * 25
ratio = CEILING(ratio*4, 1) * 25
add_overlay("[initial(icon_state)][ratio]")
update_torch()
return
@@ -89,18 +89,15 @@
flamethrower_screwdriver(I, user)
else if(istype(I, /obj/item/stack/rods))
flamethrower_rods(I, user)
else if(istype(I, /obj/item/reagent_containers) && I.is_open_container())
var/amountNeeded = max_fuel - get_fuel()
var/obj/item/reagent_containers/container = I
if(length(container.reagents.reagent_list) > 1)
to_chat(user, "<span class='warning'>[container] has too many chemicals mixed into it. You wouldn't want to put the wrong chemicals into [src].</span>")
return ..()
if(amountNeeded > 0 && container.reagents.has_reagent("welding_fuel"))
container.reagents.trans_id_to(src, "welding_fuel", amountNeeded)
to_chat(user, "<span class='notice'>You transfer some fuel from [container] to [src].</span>")
else
return ..()
. = ..()
update_icon()
/obj/item/weldingtool/proc/explode()
var/turf/T = get_turf(loc)
var/plasmaAmount = reagents.get_reagent_amount("plasma")
dyn_explosion(T, plasmaAmount/5)//20 plasma in a standard welder has a 4 power explosion. no breaches, but enough to kill/dismember holder
qdel(src)
/obj/item/weldingtool/attack(mob/living/carbon/human/H, mob/user)
if(!istype(H))
@@ -123,7 +120,10 @@
/obj/item/weldingtool/afterattack(atom/O, mob/user, proximity)
if(!proximity)
return
if(!status && O.is_refillable())
reagents.trans_to(O, reagents.total_volume)
to_chat(user, "<span class='notice'>You empty [src]'s fuel tank into [O].</span>")
update_icon()
if(welding)
remove_fuel(1)
var/turf/location = get_turf(user)
@@ -139,6 +139,9 @@
/obj/item/weldingtool/attack_self(mob/user)
if(src.reagents.has_reagent("plasma"))
message_admins("[key_name_admin(user)] activated a rigged welder.")
explode()
switched_on(user)
if(welding)
set_light(light_intensity)
@@ -234,9 +237,11 @@
return
status = !status
if(status)
to_chat(user, "<span class='notice'>You resecure [src].</span>")
to_chat(user, "<span class='notice'>You resecure [src] and close the fuel tank.</span>")
container_type = NONE
else
to_chat(user, "<span class='notice'>[src] can now be attached and modified.</span>")
to_chat(user, "<span class='notice'>[src] can now be attached, modified, and refuelled.</span>")
container_type = OPENCONTAINER
add_fingerprint(user)
/obj/item/weldingtool/proc/flamethrower_rods(obj/item/I, mob/user)
@@ -264,7 +269,7 @@
desc = "A slightly larger welder with a larger tank."
icon_state = "indwelder"
max_fuel = 40
materials = list(MAT_GLASS=60)
materials = list(MAT_GLASS=60)
/obj/item/weldingtool/largetank/cyborg
name = "integrated welding tool"
@@ -294,7 +299,7 @@
icon_state = "welder"
toolspeed = 0.1
light_intensity = 0
change_icons = 0
change_icons = 0
/obj/item/weldingtool/abductor/process()
if(get_fuel() <= max_fuel)
@@ -307,7 +312,7 @@
icon_state = "upindwelder"
item_state = "upindwelder"
max_fuel = 80
materials = list(MAT_METAL=70, MAT_GLASS=120)
materials = list(MAT_METAL=70, MAT_GLASS=120)
/obj/item/weldingtool/experimental
name = "experimental welding tool"
@@ -315,7 +320,7 @@
icon_state = "exwelder"
item_state = "exwelder"
max_fuel = 40
materials = list(MAT_METAL=70, MAT_GLASS=120)
materials = list(MAT_METAL=70, MAT_GLASS=120)
var/last_gen = 0
change_icons = 0
can_off_process = 1
@@ -336,4 +341,5 @@
if(get_fuel() < max_fuel && nextrefueltick < world.time)
nextrefueltick = world.time + 10
reagents.add_reagent("welding_fuel", 1)
#undef WELDER_FUEL_BURN_INTERVAL
#undef WELDER_FUEL_BURN_INTERVAL
+1 -1
View File
@@ -182,7 +182,7 @@
src.add_fingerprint(user)
if (src.bullets < 1)
user.show_message("<span class='warning'>*click*</span>", 2)
playsound(src, "gun_dry_fire", 50, 1)
playsound(src, "gun_dry_fire", 30, 1)
return
playsound(user, 'sound/weapons/gunshot.ogg', 100, 1)
src.bullets--
+4
View File
@@ -429,6 +429,10 @@
var/obj/item/grenade/explosive = null
var/war_cry = "AAAAARGH!!!"
/obj/item/twohanded/spear/Initialize()
. = ..()
AddComponent(/datum/component/jousting)
/obj/item/twohanded/spear/examine(mob/user)
..()
if(explosive)
+1 -1
View File
@@ -198,7 +198,7 @@ GLOBAL_DATUM_INIT(acid_overlay, /mutable_appearance, mutable_appearance('icons/e
if(T.intact && level == 1) //fire can't damage things hidden below the floor.
return
if(exposed_temperature && !(resistance_flags & FIRE_PROOF))
take_damage(Clamp(0.02 * exposed_temperature, 0, 20), BURN, "fire", 0)
take_damage(CLAMP(0.02 * exposed_temperature, 0, 20), BURN, "fire", 0)
if(!(resistance_flags & ON_FIRE) && (resistance_flags & FLAMMABLE))
resistance_flags |= ON_FIRE
SSfire_burning.processing[src] = src
+1 -1
View File
@@ -129,7 +129,7 @@
if(burn_time_remaining() < MAXIMUM_BURN_TIMER)
flame_expiry_timer = world.time + MAXIMUM_BURN_TIMER
else
fuel_added = Clamp(fuel_added + amount, 0, MAXIMUM_BURN_TIMER)
fuel_added = CLAMP(fuel_added + amount, 0, MAXIMUM_BURN_TIMER)
/obj/structure/fireplace/proc/burn_time_remaining()
if(lit)
+15 -3
View File
@@ -36,9 +36,6 @@
else
return ..()
/obj/structure/flora/tree/pine
name = "pine tree"
desc = "A coniferous pine tree."
@@ -53,6 +50,21 @@
name = "xmas tree"
desc = "A wondrous decorated Christmas tree."
icon_state = "pine_c"
var/gifts_under_tree = FALSE
var/list/ckeys_that_took = list()
/obj/structure/flora/tree/pine/xmas/attack_hand(mob/living/user)
if(!gifts_under_tree)
return
if(!user.ckey)
return
if(ckeys_that_took[user.ckey])
to_chat(user, "<span class='warning'>You already took your gift.</span>")
return
to_chat(user, "<span class='warning'>After a bit of rummaging, you locate a gift with your name on it!</span>")
ckeys_that_took[user.ckey] = TRUE
var/obj/item/a_gift/anything/A = new
user.put_in_hands(A)
/obj/structure/flora/tree/pine/xmas/Initialize()
. = ..()
+1 -1
View File
@@ -30,7 +30,7 @@
return
var/ratio = obj_integrity / max_integrity
ratio = Ceiling(ratio*4) * 25
ratio = CEILING(ratio*4, 1) * 25
if(smooth)
queue_smooth(src)
+1 -1
View File
@@ -5,7 +5,7 @@
icon_state = "cart"
anchored = FALSE
density = TRUE
container_type = OPENCONTAINER_1
container_type = OPENCONTAINER
//copypaste sorry
var/amount_per_transfer_from_this = 5 //shit I dunno, adding this so syringes stop runtime erroring. --NeoFite
var/obj/item/storage/bag/trash/mybag = null
+2 -2
View File
@@ -67,7 +67,7 @@
resistance_flags |= INDESTRUCTIBLE
/obj/structure/lattice/clockwork/ratvar_act()
if(IsOdd(x+y))
if(ISODD(x+y))
icon = 'icons/obj/smooth_structures/lattice_clockwork_large.dmi'
pixel_x = -9
pixel_y = -9
@@ -124,7 +124,7 @@
resistance_flags |= INDESTRUCTIBLE
/obj/structure/lattice/catwalk/clockwork/ratvar_act()
if(IsOdd(x+y))
if(ISODD(x+y))
icon = 'icons/obj/smooth_structures/catwalk_clockwork_large.dmi'
pixel_x = -9
pixel_y = -9
+1 -1
View File
@@ -89,7 +89,7 @@
name = "magic mirror"
desc = "Turn and face the strange... face."
icon_state = "magic_mirror"
var/list/races_blacklist = list("skeleton", "agent", "angel", "military_synth", "memezombie")
var/list/races_blacklist = list("skeleton", "agent", "angel", "military_synth", "memezombies")
var/list/choosable_races = list()
/obj/structure/mirror/magic/New()
+23 -23
View File
@@ -1,24 +1,24 @@
/obj/structure/mopbucket
name = "mop bucket"
desc = "Fill it with water, but don't forget a mop!"
icon = 'icons/obj/janitor.dmi'
icon_state = "mopbucket"
/obj/structure/mopbucket
name = "mop bucket"
desc = "Fill it with water, but don't forget a mop!"
icon = 'icons/obj/janitor.dmi'
icon_state = "mopbucket"
density = TRUE
container_type = OPENCONTAINER_1
var/amount_per_transfer_from_this = 5 //shit I dunno, adding this so syringes stop runtime erroring. --NeoFite
/obj/structure/mopbucket/New()
create_reagents(100)
..()
/obj/structure/mopbucket/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/mop))
if(reagents.total_volume < 1)
to_chat(user, "[src] is out of water!</span>")
else
reagents.trans_to(I, 5)
to_chat(user, "<span class='notice'>You wet [I] in [src].</span>")
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
else
return ..()
container_type = OPENCONTAINER
var/amount_per_transfer_from_this = 5 //shit I dunno, adding this so syringes stop runtime erroring. --NeoFite
/obj/structure/mopbucket/New()
create_reagents(100)
..()
/obj/structure/mopbucket/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/mop))
if(reagents.total_volume < 1)
to_chat(user, "[src] is out of water!</span>")
else
reagents.trans_to(I, 5)
to_chat(user, "<span class='notice'>You wet [I] in [src].</span>")
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
else
return ..()
+1 -1
View File
@@ -119,7 +119,7 @@
else
cur_oct[cur_note] = text2num(ni)
if(user.dizziness > 0 && prob(user.dizziness / 2))
cur_note = Clamp(cur_note + rand(round(-user.dizziness / 10), round(user.dizziness / 10)), 1, 7)
cur_note = CLAMP(cur_note + rand(round(-user.dizziness / 10), round(user.dizziness / 10)), 1, 7)
if(user.dizziness > 0 && prob(user.dizziness / 5))
if(prob(30))
cur_acc[cur_note] = "#"
+12 -21
View File
@@ -165,7 +165,7 @@
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
return
if(!isnull(new_angle))
setAngle(NORM_ROT(new_angle))
setAngle(SIMPLIFY_DEGREES(new_angle))
return TRUE
/obj/structure/reflector/AltClick(mob/user)
@@ -197,16 +197,12 @@
anchored = TRUE
/obj/structure/reflector/single/auto_reflect(obj/item/projectile/P, pdir, turf/ploc, pangle)
var/incidence = get_angle_of_incidence(rotation_angle, P.Angle)
var/incidence_norm = get_angle_of_incidence(rotation_angle, P.Angle, FALSE)
if((incidence_norm > -90) && (incidence_norm < 90))
var/incidence = GET_ANGLE_OF_INCIDENCE(rotation_angle, P.Angle)
var/norm_inc = WRAP(incidence, -90, 90)
var/new_angle = WRAP(rotation_angle + norm_inc, 180, -180)
if(ISINRANGE_EX(norm_inc, -90, 90))
return FALSE
var/new_angle_s = rotation_angle + incidence
while(new_angle_s > 180) // Translate to regular projectile degrees
new_angle_s -= 360
while(new_angle_s < -180)
new_angle_s += 360
P.Angle = new_angle_s
P.Angle = new_angle
return ..()
//DOUBLE
@@ -228,17 +224,12 @@
anchored = TRUE
/obj/structure/reflector/double/auto_reflect(obj/item/projectile/P, pdir, turf/ploc, pangle)
var/incidence = get_angle_of_incidence(rotation_angle, P.Angle)
var/incidence_norm = get_angle_of_incidence(rotation_angle, P.Angle, FALSE)
var/invert = ((incidence_norm > -90) && (incidence_norm < 90))
var/new_angle_s = rotation_angle + incidence
if(invert)
new_angle_s += 180
while(new_angle_s > 180) // Translate to regular projectile degrees
new_angle_s -= 360
while(new_angle_s < -180)
new_angle_s += 360
P.Angle = new_angle_s
var/incidence = GET_ANGLE_OF_INCIDENCE(rotation_angle, P.Angle)
var/norm_inc = WRAP(incidence, -90, 90)
var/new_angle = WRAP(rotation_angle + norm_inc, 180, -180)
if(ISINRANGE_EX(norm_inc, -90, 90))
new_angle += 180
P.Angle = new_angle
return ..()
//BOX
+2 -2
View File
@@ -134,8 +134,8 @@
if(!click_params || !click_params["icon-x"] || !click_params["icon-y"])
return
//Clamp it so that the icon never moves more than 16 pixels in either direction (thus leaving the table turf)
I.pixel_x = Clamp(text2num(click_params["icon-x"]) - 16, -(world.icon_size/2), world.icon_size/2)
I.pixel_y = Clamp(text2num(click_params["icon-y"]) - 16, -(world.icon_size/2), world.icon_size/2)
I.pixel_x = CLAMP(text2num(click_params["icon-x"]) - 16, -(world.icon_size/2), world.icon_size/2)
I.pixel_y = CLAMP(text2num(click_params["icon-y"]) - 16, -(world.icon_size/2), world.icon_size/2)
return 1
else
return ..()
+3 -3
View File
@@ -483,9 +483,9 @@
if(istype(O, /obj/item/reagent_containers))
var/obj/item/reagent_containers/RG = O
if(RG.container_type & OPENCONTAINER_1)
if(RG.is_refillable())
if(!RG.reagents.holder_full())
RG.reagents.add_reagent("[dispensedreagent]", min(RG.volume - RG.reagents.total_volume, RG.amount_per_transfer_from_this))
RG.reagents.add_reagent(dispensedreagent, min(RG.volume - RG.reagents.total_volume, RG.amount_per_transfer_from_this))
to_chat(user, "<span class='notice'>You fill [RG] from [src].</span>")
return TRUE
to_chat(user, "<span class='notice'>\The [RG] is full.</span>")
@@ -533,7 +533,7 @@
O.clean_blood()
O.acid_level = 0
create_reagents(5)
reagents.add_reagent("[dispensedreagent]", 5)
reagents.add_reagent(dispensedreagent, 5)
reagents.reaction(O, TOUCH)
user.visible_message("<span class='notice'>[user] washes [O] using [src].</span>", \
"<span class='notice'>You wash [O] using [src].</span>")
+1 -1
View File
@@ -379,7 +379,7 @@
return
var/ratio = obj_integrity / max_integrity
ratio = Ceiling(ratio*4) * 25
ratio = CEILING(ratio*4, 1) * 25
if(smooth)
queue_smooth(src)