[5654] Makes this PR Compile

This one made me cry.
This commit is contained in:
Unknown
2019-02-23 12:30:16 -05:00
parent fc178c1e04
commit a4317b1910
19 changed files with 36 additions and 679 deletions

View File

@@ -179,29 +179,29 @@
/obj/machinery/partslathe/proc/canBuild(var/datum/category_item/partslathe/D) /obj/machinery/partslathe/proc/canBuild(var/datum/category_item/partslathe/D)
for(var/M in D.resources) for(var/M in D.resources)
if(materials[M] < Ceiling(D.resources[M] * mat_efficiency)) if(materials[M] < CEILING((D.resources[M] * mat_efficiency), 1))
return 0 return 0
return 1 return 1
/obj/machinery/partslathe/proc/getLackingMaterials(var/datum/category_item/partslathe/D) /obj/machinery/partslathe/proc/getLackingMaterials(var/datum/category_item/partslathe/D)
var/ret = "" var/ret = ""
for(var/M in D.resources) for(var/M in D.resources)
if(materials[M] < Ceiling(D.resources[M] * mat_efficiency)) if(materials[M] < CEILING((D.resources[M] * mat_efficiency), 1))
if(ret != "") if(ret != "")
ret += ", " ret += ", "
ret += "[Ceiling(D.resources[M] * mat_efficiency) - materials[M]] [M]" ret += "[CEILING((D.resources[M] * mat_efficiency), 1) - materials[M]] [M]"
return ret return ret
/obj/machinery/partslathe/proc/build(var/datum/category_item/partslathe/D) /obj/machinery/partslathe/proc/build(var/datum/category_item/partslathe/D)
for(var/M in D.resources) for(var/M in D.resources)
materials[M] = max(0, materials[M] - Ceiling(D.resources[M] * mat_efficiency)) materials[M] = max(0, materials[M] - CEILING((D.resources[M] * mat_efficiency), 1))
var/obj/new_item = D.build(loc); var/obj/new_item = D.build(loc);
if(new_item) if(new_item)
new_item.loc = loc new_item.loc = loc
if(mat_efficiency < 1) // No matter out of nowhere if(mat_efficiency < 1) // No matter out of nowhere
if(new_item.matter && new_item.matter.len > 0) if(new_item.matter && new_item.matter.len > 0)
for(var/i in new_item.matter) for(var/i in new_item.matter)
new_item.matter[i] = Ceiling(new_item.matter[i] * mat_efficiency) new_item.matter[i] = CEILING((new_item.matter[i] * mat_efficiency), 1)
// 0 amount = 0 means ejecting a full stack; -1 means eject everything // 0 amount = 0 means ejecting a full stack; -1 means eject everything
/obj/machinery/partslathe/proc/eject_materials(var/material, var/amount) /obj/machinery/partslathe/proc/eject_materials(var/material, var/amount)

View File

@@ -1,4 +1,3 @@
<<<<<<< HEAD
#define WELDER_FUEL_BURN_INTERVAL 13 #define WELDER_FUEL_BURN_INTERVAL 13
/* /*
* Welding Tool * Welding Tool
@@ -122,12 +121,8 @@
++burned_fuel_for ++burned_fuel_for
if(burned_fuel_for >= WELDER_FUEL_BURN_INTERVAL) if(burned_fuel_for >= WELDER_FUEL_BURN_INTERVAL)
remove_fuel(1) remove_fuel(1)
if(get_fuel() < 1) if(get_fuel() < 1)
setWelding(0) setWelding(0)
//I'm not sure what this does. I assume it has to do with starting fires... //I'm not sure what this does. I assume it has to do with starting fires...
//...but it doesnt check to see if the welder is on or not. //...but it doesnt check to see if the welder is on or not.
var/turf/location = src.loc var/turf/location = src.loc
@@ -138,7 +133,6 @@
if (istype(location, /turf)) if (istype(location, /turf))
location.hotspot_expose(700, 5) location.hotspot_expose(700, 5)
/obj/item/weapon/weldingtool/afterattack(obj/O as obj, mob/user as mob, proximity) /obj/item/weapon/weldingtool/afterattack(obj/O as obj, mob/user as mob, proximity)
if(!proximity) return if(!proximity) return
if (istype(O, /obj/structure/reagent_dispensers/fueltank) && get_dist(src,O) <= 1) if (istype(O, /obj/structure/reagent_dispensers/fueltank) && get_dist(src,O) <= 1)
@@ -165,12 +159,9 @@
L.IgniteMob() L.IgniteMob()
if (istype(location, /turf)) if (istype(location, /turf))
location.hotspot_expose(700, 50, 1) location.hotspot_expose(700, 50, 1)
return
/obj/item/weapon/weldingtool/attack_self(mob/user as mob) /obj/item/weapon/weldingtool/attack_self(mob/user as mob)
setWelding(!welding, usr) setWelding(!welding, usr)
return
//Returns the amount of fuel in the welder //Returns the amount of fuel in the welder
/obj/item/weapon/weldingtool/proc/get_fuel() /obj/item/weapon/weldingtool/proc/get_fuel()
@@ -199,7 +190,7 @@
//Returns whether or not the welding tool is currently on. //Returns whether or not the welding tool is currently on.
/obj/item/weapon/weldingtool/proc/isOn() /obj/item/weapon/weldingtool/proc/isOn()
return src.welding return welding
/obj/item/weapon/weldingtool/update_icon() /obj/item/weapon/weldingtool/update_icon()
..() ..()
@@ -215,7 +206,7 @@
// Fuel counter overlay. // Fuel counter overlay.
if(change_icons && get_max_fuel()) if(change_icons && get_max_fuel())
var/ratio = get_fuel() / get_max_fuel() var/ratio = get_fuel() / get_max_fuel()
ratio = Ceiling(ratio*4) * 25 ratio = CEILING(ratio * 4, 1) * 25
var/image/I = image(icon, src, "[icon_state][ratio]") var/image/I = image(icon, src, "[icon_state][ratio]")
overlays.Add(I) overlays.Add(I)
@@ -611,609 +602,3 @@
toolspeed = 0.5 toolspeed = 0.5
#undef WELDER_FUEL_BURN_INTERVAL #undef WELDER_FUEL_BURN_INTERVAL
=======
#define WELDER_FUEL_BURN_INTERVAL 13
/*
* Welding Tool
*/
/obj/item/weapon/weldingtool
name = "\improper welding tool"
icon = 'icons/obj/tools.dmi'
icon_state = "welder"
item_state = "welder"
flags = CONDUCT
slot_flags = SLOT_BELT
//Amount of OUCH when it's thrown
force = 3.0
throwforce = 5.0
throw_speed = 1
throw_range = 5
w_class = ITEMSIZE_SMALL
//Cost to make in the autolathe
matter = list(DEFAULT_WALL_MATERIAL = 70, "glass" = 30)
//R&D tech level
origin_tech = list(TECH_ENGINEERING = 1)
//Welding tool specific stuff
var/welding = 0 //Whether or not the welding tool is off(0), on(1) or currently welding(2)
var/status = 1 //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
var/acti_sound = 'sound/items/welderactivate.ogg'
var/deac_sound = 'sound/items/welderdeactivate.ogg'
usesound = 'sound/items/Welder2.ogg'
var/change_icons = TRUE
var/flame_intensity = 2 //how powerful the emitted light is when used.
var/flame_color = "#FF9933" // What color the welder light emits when its on. Default is an orange-ish color.
var/eye_safety_modifier = 0 // Increasing this will make less eye protection needed to stop eye damage. IE at 1, sunglasses will fully protect.
var/burned_fuel_for = 0 // Keeps track of how long the welder's been on, used to gradually empty the welder if left one, without RNG.
var/always_process = FALSE // If true, keeps the welder on the process list even if it's off. Used for when it needs to regenerate fuel.
toolspeed = 1
/obj/item/weapon/weldingtool/New()
// var/random_fuel = min(rand(10,20),max_fuel)
var/datum/reagents/R = new/datum/reagents(max_fuel)
reagents = R
R.my_atom = src
R.add_reagent("fuel", max_fuel)
update_icon()
if(always_process)
processing_objects |= src
..()
/obj/item/weapon/weldingtool/Destroy()
if(welding || always_process)
processing_objects -= src
return ..()
/obj/item/weapon/weldingtool/examine(mob/user)
if(..(user, 0))
if(max_fuel)
to_chat(user, text("\icon[] The [] contains []/[] units of fuel!", src, src.name, get_fuel(),src.max_fuel ))
/obj/item/weapon/weldingtool/attack(var/atom/A, var/mob/living/user, var/def_zone)
if(ishuman(A) && user.a_intent == I_HELP)
var/mob/living/carbon/human/H = A
var/obj/item/organ/external/S = H.organs_by_name[user.zone_sel.selecting]
if(!S || S.robotic < ORGAN_ROBOT || S.open == 3)
return ..()
if(!welding)
to_chat(user, "<span class='warning'>You'll need to turn [src] on to patch the damage on [H]'s [S.name]!</span>")
return 1
if(S.robo_repair(15, BRUTE, "some dents", src, user))
remove_fuel(1, user)
return 1
return ..()
/obj/item/weapon/weldingtool/attackby(obj/item/W as obj, mob/living/user as mob)
if(istype(W,/obj/item/weapon/tool/screwdriver))
if(welding)
to_chat(user, "<span class='danger'>Stop welding first!</span>")
return
status = !status
if(status)
to_chat(user, "<span class='notice'>You secure the welder.</span>")
else
to_chat(user, "<span class='notice'>The welder can now be attached and modified.</span>")
src.add_fingerprint(user)
return
if((!status) && (istype(W,/obj/item/stack/rods)))
var/obj/item/stack/rods/R = W
R.use(1)
var/obj/item/weapon/flamethrower/F = new/obj/item/weapon/flamethrower(user.loc)
src.loc = F
F.weldtool = src
if (user.client)
user.client.screen -= src
if (user.r_hand == src)
user.remove_from_mob(src)
else
user.remove_from_mob(src)
src.master = F
src.layer = initial(src.layer)
user.remove_from_mob(src)
if (user.client)
user.client.screen -= src
src.loc = F
src.add_fingerprint(user)
return
..()
return
/obj/item/weapon/weldingtool/process()
if(welding)
++burned_fuel_for
if(burned_fuel_for >= WELDER_FUEL_BURN_INTERVAL)
remove_fuel(1)
if(get_fuel() < 1)
setWelding(0)
//I'm not sure what this does. I assume it has to do with starting fires...
//...but it doesnt check to see if the welder is on or not.
var/turf/location = src.loc
if(istype(location, /mob/living))
var/mob/living/M = location
if(M.item_is_in_hands(src))
location = get_turf(M)
if (istype(location, /turf))
location.hotspot_expose(700, 5)
/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)
if(!welding && max_fuel)
O.reagents.trans_to_obj(src, max_fuel)
to_chat(user, "<span class='notice'>Welder refueled</span>")
playsound(src.loc, 'sound/effects/refill.ogg', 50, 1, -6)
return
else if(!welding)
to_chat(user, "<span class='notice'>[src] doesn't use fuel.</span>")
return
else
message_admins("[key_name_admin(user)] triggered a fueltank explosion with a welding tool.")
log_game("[key_name(user)] triggered a fueltank explosion with a welding tool.")
to_chat(user, "<span class='danger'>You begin welding on the fueltank and with a moment of lucidity you realize, this might not have been the smartest thing you've ever done.</span>")
var/obj/structure/reagent_dispensers/fueltank/tank = O
tank.explode()
return
if (src.welding)
remove_fuel(1)
var/turf/location = get_turf(user)
if(isliving(O))
var/mob/living/L = O
L.IgniteMob()
if (istype(location, /turf))
location.hotspot_expose(700, 50, 1)
/obj/item/weapon/weldingtool/attack_self(mob/user as mob)
setWelding(!welding, usr)
//Returns the amount of fuel in the welder
/obj/item/weapon/weldingtool/proc/get_fuel()
return reagents.get_reagent_amount("fuel")
/obj/item/weapon/weldingtool/proc/get_max_fuel()
return max_fuel
//Removes fuel from the welding tool. If a mob is passed, it will perform an eyecheck on the mob. This should probably be renamed to use()
/obj/item/weapon/weldingtool/proc/remove_fuel(var/amount = 1, var/mob/M = null)
if(!welding)
return 0
if(amount)
burned_fuel_for = 0 // Reset the counter since we're removing fuel.
if(get_fuel() >= amount)
reagents.remove_reagent("fuel", amount)
if(M)
eyecheck(M)
update_icon()
return 1
else
if(M)
to_chat(M, "<span class='notice'>You need more welding fuel to complete this task.</span>")
update_icon()
return 0
//Returns whether or not the welding tool is currently on.
/obj/item/weapon/weldingtool/proc/isOn()
return welding
/obj/item/weapon/weldingtool/update_icon()
..()
overlays.Cut()
// Welding overlay.
if(welding)
var/image/I = image(icon, src, "[icon_state]-on")
overlays.Add(I)
item_state = "[initial(item_state)]1"
else
item_state = initial(item_state)
// Fuel counter overlay.
if(change_icons && get_max_fuel())
var/ratio = get_fuel() / get_max_fuel()
ratio = CEILING(ratio * 4, 1) * 25
var/image/I = image(icon, src, "[icon_state][ratio]")
overlays.Add(I)
// Lights
if(welding && flame_intensity)
set_light(flame_intensity, flame_intensity, flame_color)
else
set_light(0)
// icon_state = welding ? "[icon_state]1" : "[initial(icon_state)]"
var/mob/M = loc
if(istype(M))
M.update_inv_l_hand()
M.update_inv_r_hand()
/obj/item/weapon/weldingtool/MouseDrop(obj/over_object as obj)
if(!canremove)
return
if (ishuman(usr) || issmall(usr)) //so monkeys can take off their backpacks -- Urist
if (istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech. why?
return
if (!( istype(over_object, /obj/screen) ))
return ..()
//makes sure that the thing is equipped, so that we can't drag it into our hand from miles away.
//there's got to be a better way of doing this.
if (!(src.loc == usr) || (src.loc && src.loc.loc == usr))
return
if (( usr.restrained() ) || ( usr.stat ))
return
if ((src.loc == usr) && !(istype(over_object, /obj/screen)) && !usr.unEquip(src))
return
switch(over_object.name)
if("r_hand")
usr.u_equip(src)
usr.put_in_r_hand(src)
if("l_hand")
usr.u_equip(src)
usr.put_in_l_hand(src)
src.add_fingerprint(usr)
//Sets the welding state of the welding tool. If you see W.welding = 1 anywhere, please change it to W.setWelding(1)
//so that the welding tool updates accordingly
/obj/item/weapon/weldingtool/proc/setWelding(var/set_welding, var/mob/M)
if(!status) return
var/turf/T = get_turf(src)
//If we're turning it on
if(set_welding && !welding)
if (get_fuel() > 0)
if(M)
to_chat(M, "<span class='notice'>You switch the [src] on.</span>")
else if(T)
T.visible_message("<span class='danger'>\The [src] turns on.</span>")
playsound(loc, acti_sound, 50, 1)
src.force = 15
src.damtype = "fire"
src.w_class = ITEMSIZE_LARGE
src.hitsound = 'sound/items/welder.ogg'
welding = 1
update_icon()
if(!always_process)
processing_objects |= src
else
if(M)
var/msg = max_fuel ? "welding fuel" : "charge"
to_chat(M, "<span class='notice'>You need more [msg] to complete this task.</span>")
return
//Otherwise
else if(!set_welding && welding)
if(!always_process)
processing_objects -= src
if(M)
to_chat(M, "<span class='notice'>You switch \the [src] off.</span>")
else if(T)
T.visible_message("<span class='warning'>\The [src] turns off.</span>")
playsound(loc, deac_sound, 50, 1)
src.force = 3
src.damtype = "brute"
src.w_class = initial(src.w_class)
src.welding = 0
src.hitsound = initial(src.hitsound)
update_icon()
//Decides whether or not to damage a player's eyes based on what they're wearing as protection
//Note: This should probably be moved to mob
/obj/item/weapon/weldingtool/proc/eyecheck(mob/living/carbon/user)
if(!istype(user))
return 1
var/safety = user.eyecheck()
safety = between(-1, safety + eye_safety_modifier, 2)
if(istype(user, /mob/living/carbon/human))
var/mob/living/carbon/human/H = user
var/obj/item/organ/internal/eyes/E = H.internal_organs_by_name[O_EYES]
if(!E)
return
switch(safety)
if(1)
to_chat(usr, "<span class='warning'>Your eyes sting a little.</span>")
E.damage += rand(1, 2)
if(E.damage > 12)
user.eye_blurry += rand(3,6)
if(0)
to_chat(usr, "<span class='warning'>Your eyes burn.</span>")
E.damage += rand(2, 4)
if(E.damage > 10)
E.damage += rand(4,10)
if(-1)
to_chat(usr, "<span class='danger'>Your thermals intensify the welder's glow. Your eyes itch and burn severely.</span>")
user.eye_blurry += rand(12,20)
E.damage += rand(12, 16)
if(safety<2)
if(E.damage > 10)
to_chat(user, "<span class='warning'>Your eyes are really starting to hurt. This can't be good for you!</span>")
if (E.damage >= E.min_broken_damage)
to_chat(user, "<span class='danger'>You go blind!</span>")
user.sdisabilities |= BLIND
else if (E.damage >= E.min_bruised_damage)
to_chat(user, "<span class='danger'>You go blind!</span>")
user.Blind(5)
user.eye_blurry = 5
user.disabilities |= NEARSIGHTED
spawn(100)
user.disabilities &= ~NEARSIGHTED
return
/obj/item/weapon/weldingtool/is_hot()
return isOn()
/obj/item/weapon/weldingtool/largetank
name = "industrial welding tool"
desc = "A slightly larger welder with a larger tank."
icon_state = "indwelder"
max_fuel = 40
origin_tech = list(TECH_ENGINEERING = 2, TECH_PHORON = 2)
matter = list(DEFAULT_WALL_MATERIAL = 70, "glass" = 60)
/obj/item/weapon/weldingtool/largetank/cyborg
name = "integrated welding tool"
desc = "An advanced welder designed to be used in robotic systems."
toolspeed = 0.5
/obj/item/weapon/weldingtool/hugetank
name = "upgraded welding tool"
desc = "A much larger welder with a huge tank."
icon_state = "indwelder"
max_fuel = 80
w_class = ITEMSIZE_NORMAL
origin_tech = list(TECH_ENGINEERING = 3)
matter = list(DEFAULT_WALL_MATERIAL = 70, "glass" = 120)
/obj/item/weapon/weldingtool/mini
name = "emergency welding tool"
desc = "A miniature welder used during emergencies."
icon_state = "miniwelder"
max_fuel = 10
w_class = ITEMSIZE_SMALL
matter = list(MAT_METAL = 30, MAT_GLASS = 10)
change_icons = 0
toolspeed = 2
eye_safety_modifier = 1 // Safer on eyes.
/obj/item/weapon/weldingtool/alien
name = "alien welding tool"
desc = "An alien welding tool. Whatever fuel it uses, it never runs out."
icon = 'icons/obj/abductor.dmi'
icon_state = "welder"
toolspeed = 0.1
flame_color = "#6699FF" // Light bluish.
eye_safety_modifier = 2
change_icons = 0
origin_tech = list(TECH_PHORON = 5 ,TECH_ENGINEERING = 5)
always_process = TRUE
/obj/item/weapon/weldingtool/alien/process()
if(get_fuel() <= get_max_fuel())
reagents.add_reagent("fuel", 1)
..()
/obj/item/weapon/weldingtool/experimental
name = "experimental welding tool"
desc = "An experimental welder capable of synthesizing its own fuel from waste compounds. It can output a flame hotter than regular welders."
icon_state = "exwelder"
max_fuel = 40
w_class = ITEMSIZE_NORMAL
origin_tech = list(TECH_ENGINEERING = 4, TECH_PHORON = 3)
matter = list(DEFAULT_WALL_MATERIAL = 70, "glass" = 120)
toolspeed = 0.5
change_icons = 0
flame_intensity = 3
always_process = TRUE
var/nextrefueltick = 0
/obj/item/weapon/weldingtool/experimental/process()
..()
if(get_fuel() < get_max_fuel() && nextrefueltick < world.time)
nextrefueltick = world.time + 10
reagents.add_reagent("fuel", 1)
/*
* Backpack Welder.
*/
/obj/item/weapon/weldingtool/tubefed
name = "tube-fed welding tool"
desc = "A bulky, cooler-burning welding tool that draws from a worn welding tank."
icon_state = "tubewelder"
max_fuel = 10
w_class = ITEMSIZE_NO_CONTAINER
matter = null
toolspeed = 1.25
change_icons = 0
flame_intensity = 1
eye_safety_modifier = 1
always_process = TRUE
var/obj/item/weapon/weldpack/mounted_pack = null
/obj/item/weapon/weldingtool/tubefed/New(location)
..()
if(istype(location, /obj/item/weapon/weldpack))
var/obj/item/weapon/weldpack/holder = location
mounted_pack = holder
else
qdel(src)
/obj/item/weapon/weldingtool/tubefed/Destroy()
mounted_pack.nozzle = null
mounted_pack = null
return ..()
/obj/item/weapon/weldingtool/tubefed/process()
if(mounted_pack)
if(!istype(mounted_pack.loc,/mob/living/carbon/human))
mounted_pack.return_nozzle()
else
var/mob/living/carbon/human/H = mounted_pack.loc
if(H.back != mounted_pack)
mounted_pack.return_nozzle()
if(mounted_pack.loc != src.loc && src.loc != mounted_pack)
mounted_pack.return_nozzle()
visible_message("<span class='notice'>\The [src] retracts to its fueltank.</span>")
if(get_fuel() <= get_max_fuel())
mounted_pack.reagents.trans_to_obj(src, 1)
..()
/obj/item/weapon/weldingtool/tubefed/dropped(mob/user)
..()
if(src.loc != user)
mounted_pack.return_nozzle()
to_chat(user, "<span class='notice'>\The [src] retracts to its fueltank.</span>")
/*
* Electric/Arc Welder
*/
/obj/item/weapon/weldingtool/electric //AND HIS WELDING WAS ELECTRIC
name = "electric welding tool"
desc = "A welder which runs off of electricity."
icon_state = "arcwelder"
max_fuel = 0 //We'll handle the consumption later.
item_state = "ewelder"
var/obj/item/weapon/cell/power_supply //What type of power cell this uses
var/charge_cost = 24 //The rough equivalent of 1 unit of fuel, based on us wanting 10 welds per battery
var/cell_type = /obj/item/weapon/cell/device
var/use_external_power = 0 //If in a borg or hardsuit, this needs to = 1
flame_color = "#00CCFF" // Blue-ish, to set it apart from the gas flames.
acti_sound = 'sound/effects/sparks4.ogg'
deac_sound = 'sound/effects/sparks4.ogg'
/obj/item/weapon/weldingtool/electric/unloaded/New()
cell_type = null
/obj/item/weapon/weldingtool/electric/New()
..()
if(cell_type == null)
update_icon()
else if(cell_type)
power_supply = new cell_type(src)
else
power_supply = new /obj/item/weapon/cell/device(src)
update_icon()
/obj/item/weapon/weldingtool/electric/get_cell()
return power_supply
/obj/item/weapon/weldingtool/electric/examine(mob/user)
if(get_dist(src, user) > 1)
to_chat(user, desc)
else // The << need to stay, for some reason
if(power_supply)
user << text("\icon[] The [] has [] charge left.", src, src.name, get_fuel())
else
user << text("\icon[] The [] has no power cell!", src, src.name)
/obj/item/weapon/weldingtool/electric/get_fuel()
if(use_external_power)
var/obj/item/weapon/cell/external = get_external_power_supply()
if(external)
return external.charge
else if(power_supply)
return power_supply.charge
else
return 0
/obj/item/weapon/weldingtool/electric/get_max_fuel()
if(use_external_power)
var/obj/item/weapon/cell/external = get_external_power_supply()
if(external)
return external.maxcharge
else if(power_supply)
return power_supply.maxcharge
return 0
/obj/item/weapon/weldingtool/electric/remove_fuel(var/amount = 1, var/mob/M = null)
if(!welding)
return 0
if(get_fuel() >= amount)
power_supply.checked_use(charge_cost)
if(use_external_power)
var/obj/item/weapon/cell/external = get_external_power_supply()
if(!external || !external.use(charge_cost)) //Take power from the borg...
power_supply.give(charge_cost) //Give it back to the cell.
if(M)
eyecheck(M)
update_icon()
return 1
else
if(M)
to_chat(M, "<span class='notice'>You need more energy to complete this task.</span>")
update_icon()
return 0
/obj/item/weapon/weldingtool/electric/attack_hand(mob/user as mob)
if(user.get_inactive_hand() == src)
if(power_supply)
power_supply.update_icon()
user.put_in_hands(power_supply)
power_supply = null
to_chat(user, "<span class='notice'>You remove the cell from the [src].</span>")
setWelding(0)
update_icon()
return
..()
else
return ..()
/obj/item/weapon/weldingtool/electric/attackby(obj/item/weapon/W, mob/user as mob)
if(istype(W, /obj/item/weapon/cell))
if(istype(W, /obj/item/weapon/cell/device))
if(!power_supply)
user.drop_item()
W.loc = src
power_supply = W
to_chat(user, "<span class='notice'>You install a cell in \the [src].</span>")
update_icon()
else
to_chat(user, "<span class='notice'>\The [src] already has a cell.</span>")
else
to_chat(user, "<span class='notice'>\The [src] cannot use that type of cell.</span>")
else
..()
/obj/item/weapon/weldingtool/electric/proc/get_external_power_supply()
if(isrobot(src.loc))
var/mob/living/silicon/robot/R = src.loc
return R.cell
if(istype(src.loc, /obj/item/rig_module))
var/obj/item/rig_module/module = src.loc
if(module.holder && module.holder.wearer)
var/mob/living/carbon/human/H = module.holder.wearer
if(istype(H) && H.back)
var/obj/item/weapon/rig/suit = H.back
if(istype(suit))
return suit.cell
return null
/obj/item/weapon/weldingtool/electric/mounted
use_external_power = 1
/obj/item/weapon/weldingtool/electric/mounted/cyborg
toolspeed = 0.5
#undef WELDER_FUEL_BURN_INTERVAL
>>>>>>> 8da11c1... Makes math helpers defines for performance (#5654)

View File

@@ -60,7 +60,7 @@
/datum/category_item/player_setup_item/vore/size/OnTopic(var/href, var/list/href_list, var/mob/user) /datum/category_item/player_setup_item/vore/size/OnTopic(var/href, var/list/href_list, var/mob/user)
if(href_list["size_multiplier"]) if(href_list["size_multiplier"])
var/new_size = input(user, "Choose your character's size, ranging from 25% to 200%", "Set Size") as num|null var/new_size = input(user, "Choose your character's size, ranging from 25% to 200%", "Set Size") as num|null
if (!IsInRange(new_size,25,200)) if (!ISINRANGE(new_size,25,200))
pref.size_multiplier = 1 pref.size_multiplier = 1
user << "<span class='notice'>Invalid size.</span>" user << "<span class='notice'>Invalid size.</span>"
return TOPIC_REFRESH_UPDATE_PREVIEW return TOPIC_REFRESH_UPDATE_PREVIEW

View File

@@ -85,7 +85,7 @@
H.update_icons() //Just want the matrix transform H.update_icons() //Just want the matrix transform
return return
if (!IsInRange(new_size,25,200)) if (!ISINRANGE(new_size,25,200))
to_chat(H,"<span class='notice'>The safety features of the uniform prevent you from choosing this size.</span>") to_chat(H,"<span class='notice'>The safety features of the uniform prevent you from choosing this size.</span>")
return return

View File

@@ -58,12 +58,8 @@
infectedMachine.shut_up = 0 infectedMachine.shut_up = 0
infectedMachine.shoot_inventory = 1 infectedMachine.shoot_inventory = 1
<<<<<<< HEAD
if(IsMultiple(activeFor, 12))
/* VORESTATION Removal - Using the pick below.
=======
if(ISMULTIPLE(activeFor, 12)) if(ISMULTIPLE(activeFor, 12))
>>>>>>> 8da11c1... Makes math helpers defines for performance (#5654) /* VORESTATION Removal - Using the pick below.
originMachine.speak(pick("Try our aggressive new marketing strategies!", \ originMachine.speak(pick("Try our aggressive new marketing strategies!", \
"You should buy products to feed your lifestyle obsession!", \ "You should buy products to feed your lifestyle obsession!", \
"Consume!", \ "Consume!", \

View File

@@ -213,7 +213,7 @@
var/amount_to_take = min(I.reagents.get_reagent_amount(reagent_id), qty_need) var/amount_to_take = min(I.reagents.get_reagent_amount(reagent_id), qty_need)
if(amount_to_take >= 1) if(amount_to_take >= 1)
I.reagents.remove_reagent(reagent_id, amount_to_take, safety = 1) I.reagents.remove_reagent(reagent_id, amount_to_take, safety = 1)
qty_need = Ceiling(qty_need - amount_to_take) qty_need = CEILING((qty_need - amount_to_take), 1)
return 1 return 1
else else
log_debug("supply_demand event: not taking reagent '[reagent_id]': [amount_to_take]") log_debug("supply_demand event: not taking reagent '[reagent_id]': [amount_to_take]")
@@ -342,6 +342,6 @@
var/datum/alloy/A = pick(types) var/datum/alloy/A = pick(types)
types -= A // Don't pick the same thing twice types -= A // Don't pick the same thing twice
var/chosen_path = initial(A.product) var/chosen_path = initial(A.product)
var/chosen_qty = Floor(rand(5, 100) * initial(A.product_mod)) var/chosen_qty = FLOOR(rand(5, 100) * initial(A.product_mod), 1)
required_items += new /datum/supply_demand_order/thing(chosen_qty, chosen_path) required_items += new /datum/supply_demand_order/thing(chosen_qty, chosen_path)
return return

View File

@@ -213,7 +213,7 @@
return //Quietly fail return //Quietly fail
var/actually_added = refactory.add_stored_material(substance,howmuch*matstack.perunit) var/actually_added = refactory.add_stored_material(substance,howmuch*matstack.perunit)
matstack.use(Ceiling(actually_added/matstack.perunit)) matstack.use(CEILING((actually_added/matstack.perunit), 1))
if(actually_added && actually_added < howmuch) if(actually_added && actually_added < howmuch)
to_chat(src,"<span class='warning'>Your refactory module is now full, so only [actually_added] units were stored.</span>") to_chat(src,"<span class='warning'>Your refactory module is now full, so only [actually_added] units were stored.</span>")
visible_message("<span class='notice'>[src] nibbles some of the [substance] right off the stack!</span>") visible_message("<span class='notice'>[src] nibbles some of the [substance] right off the stack!</span>")
@@ -283,7 +283,7 @@
var/nagmessage = "Adjust your mass to be a size between 25 to 200%. Up-sizing consumes metal, downsizing returns metal." var/nagmessage = "Adjust your mass to be a size between 25 to 200%. Up-sizing consumes metal, downsizing returns metal."
var/new_size = input(user, nagmessage, "Pick a Size", user.size_multiplier*100) as num|null var/new_size = input(user, nagmessage, "Pick a Size", user.size_multiplier*100) as num|null
if(!new_size || !IsInRange(new_size,25,200)) if(!new_size || !ISINRANGE(new_size,25,200))
return return
var/size_factor = new_size/100 var/size_factor = new_size/100

View File

@@ -85,7 +85,7 @@
return return
var/length = length(message) var/length = length(message)
var/posts = Ceiling(length/MAX_MESSAGE_LEN) var/posts = CEILING((length/MAX_MESSAGE_LEN), 1)
to_chat(user,message) to_chat(user,message)
to_chat(user,"<span class='danger'>^ This message was NOT SENT ^ -- It was [length] characters, and the limit is [MAX_MESSAGE_LEN]. It would fit in [posts] separate messages.</span>") to_chat(user,"<span class='danger'>^ This message was NOT SENT ^ -- It was [length] characters, and the limit is [MAX_MESSAGE_LEN]. It would fit in [posts] separate messages.</span>")
#undef MAX_HUGE_MESSAGE_LEN #undef MAX_HUGE_MESSAGE_LEN

View File

@@ -71,7 +71,7 @@
return FALSE return FALSE
stat_text() stat_text()
return "[active ? "Active" : "Disabled"] (Stored Heat: [Floor(used/20)]%)" return "[active ? "Active" : "Disabled"] (Stored Heat: [FLOOR((used/20), 1)]%)"
life() life()
if((. = ..())) if((. = ..()))
@@ -129,7 +129,7 @@
if((. = ..())) if((. = ..()))
var/new_size = input("Put the desired size (25-200%)", "Set Size", 200) as num var/new_size = input("Put the desired size (25-200%)", "Set Size", 200) as num
if (!IsInRange(new_size,25,200)) if (!ISINRANGE(new_size,25,200))
to_chat(nif.human,"<span class='notice'>The safety features of the NIF Program prevent you from choosing this size.</span>") to_chat(nif.human,"<span class='notice'>The safety features of the NIF Program prevent you from choosing this size.</span>")
return return
else else

View File

@@ -310,7 +310,7 @@
if(href_list["size_multiplier"]) if(href_list["size_multiplier"])
var/new_size = input(user, "Choose your character's size, ranging from 25% to 200%", "Character Preference") as num|null var/new_size = input(user, "Choose your character's size, ranging from 25% to 200%", "Character Preference") as num|null
if(new_size && IsInRange(new_size,25,200)) if(new_size && ISINRANGE(new_size,25,200))
active_br.sizemult = (new_size/100) active_br.sizemult = (new_size/100)
preview_icon = null preview_icon = null
return 1 return 1

View File

@@ -138,7 +138,7 @@
occupant.adjustCloneLoss(-2 * heal_rate) occupant.adjustCloneLoss(-2 * heal_rate)
//Premature clones may have brain damage. //Premature clones may have brain damage.
occupant.adjustBrainLoss(-(ceil(0.5*heal_rate))) occupant.adjustBrainLoss(-(CEILING((0.5*heal_rate), 1)))
//So clones don't die of oxyloss in a running pod. //So clones don't die of oxyloss in a running pod.
if(occupant.reagents.get_reagent_amount("inaprovaline") < 30) if(occupant.reagents.get_reagent_amount("inaprovaline") < 30)

View File

@@ -73,7 +73,7 @@
return ..() return ..()
/obj/machinery/computer/telescience/proc/get_max_allowed_distance() /obj/machinery/computer/telescience/proc/get_max_allowed_distance()
return Floor(crystals.len * telepad.efficiency * powerCoefficient) return FLOOR((crystals.len * telepad.efficiency * powerCoefficient), 1)
/obj/machinery/computer/telescience/attack_ai(mob/user) /obj/machinery/computer/telescience/attack_ai(mob/user)
src.attack_hand(user) src.attack_hand(user)
@@ -97,7 +97,7 @@
data["cooldown"] = max(0, min(100, round(teleport_cooldown - world.time) / 10)) data["cooldown"] = max(0, min(100, round(teleport_cooldown - world.time) / 10))
data["crystalCount"] = crystals.len data["crystalCount"] = crystals.len
data["maxCrystals"] = max_crystals data["maxCrystals"] = max_crystals
data["maxPossibleDistance"] = Floor(max_crystals * powerCoefficient * 6); // max efficiency is 6 data["maxPossibleDistance"] = FLOOR((max_crystals * powerCoefficient * 6), 1); // max efficiency is 6
data["maxAllowedDistance"] = get_max_allowed_distance() data["maxAllowedDistance"] = get_max_allowed_distance()
data["distance"] = distance data["distance"] = distance
@@ -328,7 +328,7 @@
if(..()) // Check after we input a value, as they could've moved after they entered something if(..()) // Check after we input a value, as they could've moved after they entered something
return return
distance = Clamp(new_pow, 1, get_max_allowed_distance()) distance = Clamp(new_pow, 1, get_max_allowed_distance())
distance = Floor(distance) distance = FLOOR(distance, 1)
if(href_list["setz"]) if(href_list["setz"])
var/new_z = text2num(href_list["setz"]) var/new_z = text2num(href_list["setz"])

View File

@@ -59,13 +59,8 @@
if(NORTH) if(NORTH)
<<<<<<< HEAD
int_panel_x = ux + Floor(lift_size_x/2)
int_panel_y = uy + (make_walls ? 1 : 0)
=======
int_panel_x = ux + FLOOR(lift_size_x/2, 1) int_panel_x = ux + FLOOR(lift_size_x/2, 1)
int_panel_y = uy + 1 int_panel_y = uy + 1
>>>>>>> 8da11c1... Makes math helpers defines for performance (#5654)
ext_panel_x = ux ext_panel_x = ux
ext_panel_y = ey + 2 ext_panel_y = ey + 2
@@ -81,13 +76,8 @@
if(SOUTH) if(SOUTH)
<<<<<<< HEAD
int_panel_x = ux + Floor(lift_size_x/2)
int_panel_y = ey - (make_walls ? 1 : 0)
=======
int_panel_x = ux + FLOOR(lift_size_x/2, 1) int_panel_x = ux + FLOOR(lift_size_x/2, 1)
int_panel_y = ey - 1 int_panel_y = ey - 1
>>>>>>> 8da11c1... Makes math helpers defines for performance (#5654)
ext_panel_x = ex ext_panel_x = ex
ext_panel_y = uy - 2 ext_panel_y = uy - 2
@@ -103,13 +93,8 @@
if(EAST) if(EAST)
<<<<<<< HEAD
int_panel_x = ux + (make_walls ? 1 : 0)
int_panel_y = uy + Floor(lift_size_y/2)
=======
int_panel_x = ux+1 int_panel_x = ux+1
int_panel_y = uy + FLOOR(lift_size_y/2, 1) int_panel_y = uy + FLOOR(lift_size_y/2, 1)
>>>>>>> 8da11c1... Makes math helpers defines for performance (#5654)
ext_panel_x = ex+2 ext_panel_x = ex+2
ext_panel_y = ey ext_panel_y = ey
@@ -125,13 +110,8 @@
if(WEST) if(WEST)
<<<<<<< HEAD
int_panel_x = ex - (make_walls ? 1 : 0)
int_panel_y = uy + Floor(lift_size_y/2)
=======
int_panel_x = ex-1 int_panel_x = ex-1
int_panel_y = uy + FLOOR(lift_size_y/2, 1) int_panel_y = uy + FLOOR(lift_size_y/2, 1)
>>>>>>> 8da11c1... Makes math helpers defines for performance (#5654)
ext_panel_x = ux-2 ext_panel_x = ux-2
ext_panel_y = uy ext_panel_y = uy

View File

@@ -634,7 +634,7 @@
if(new_bulge == 0) //Disable. if(new_bulge == 0) //Disable.
selected.bulge_size = 0 selected.bulge_size = 0
to_chat(user,"<span class='notice'>Your stomach will not be seen on examine.</span>") to_chat(user,"<span class='notice'>Your stomach will not be seen on examine.</span>")
else if (!IsInRange(new_bulge,25,200)) else if (!ISINRANGE(new_bulge,25,200))
selected.bulge_size = 0.25 //Set it to the default. selected.bulge_size = 0.25 //Set it to the default.
to_chat(user,"<span class='notice'>Invalid size.</span>") to_chat(user,"<span class='notice'>Invalid size.</span>")
else if(new_bulge) else if(new_bulge)
@@ -644,7 +644,7 @@
var/new_grow = input(user, "Choose the size that prey will be grown/shrunk to, ranging from 25% to 200%", "Set Growth Shrink Size.", selected.shrink_grow_size) as num|null var/new_grow = input(user, "Choose the size that prey will be grown/shrunk to, ranging from 25% to 200%", "Set Growth Shrink Size.", selected.shrink_grow_size) as num|null
if (new_grow == null) if (new_grow == null)
return return
if (!IsInRange(new_grow,25,200)) if (!ISINRANGE(new_grow,25,200))
selected.shrink_grow_size = 1 //Set it to the default selected.shrink_grow_size = 1 //Set it to the default
to_chat(user,"<span class='notice'>Invalid size.</span>") to_chat(user,"<span class='notice'>Invalid size.</span>")
else if(new_grow) else if(new_grow)

View File

@@ -134,7 +134,7 @@
add_overlay(barrel_color) add_overlay(barrel_color)
//Charge bar //Charge bar
var/ratio = Ceiling((charge_left / max_charge) * charge_sections) var/ratio = CEILING(((charge_left / max_charge) * charge_sections), 1)
for(var/i = 0, i < ratio, i++) for(var/i = 0, i < ratio, i++)
var/image/charge_bar = image(icon, icon_state = "[initial(icon_state)]_charge") var/image/charge_bar = image(icon, icon_state = "[initial(icon_state)]_charge")
charge_bar.pixel_x = i charge_bar.pixel_x = i
@@ -174,7 +174,7 @@
add_overlay(cap) add_overlay(cap)
if(batt.shots_left) if(batt.shots_left)
var/ratio = Ceiling((batt.shots_left / initial(batt.shots_left)) * 4) //4 is how many lights we have a sprite for var/ratio = CEILING(((batt.shots_left / initial(batt.shots_left)) * 4), 1) //4 is how many lights we have a sprite for
var/image/charge = image(icon, icon_state = "[initial(icon_state)]_charge-[ratio]") var/image/charge = image(icon, icon_state = "[initial(icon_state)]_charge-[ratio]")
charge.color = "#29EAF4" //Could use battery color but eh. charge.color = "#29EAF4" //Could use battery color but eh.
charge.pixel_x = current * x_offset charge.pixel_x = current * x_offset

View File

@@ -72,7 +72,7 @@
itemState += "[modifystate]" itemState += "[modifystate]"
*/ */
if(power_supply) if(power_supply)
ratio = Ceiling((power_supply.charge / power_supply.maxcharge) * charge_sections) ratio = CEILING(((power_supply.charge / power_supply.maxcharge) * charge_sections), 1)
if(power_supply.charge < charge_cost) if(power_supply.charge < charge_cost)
overlays += "[icon_state]_empty" overlays += "[icon_state]_empty"

View File

@@ -109,7 +109,7 @@ var/const/RESIZE_A_SMALLTINY = (RESIZE_SMALL + RESIZE_TINY) / 2
var/nagmessage = "Adjust your mass to be a size between 25 to 200% (DO NOT ABUSE)" var/nagmessage = "Adjust your mass to be a size between 25 to 200% (DO NOT ABUSE)"
var/new_size = input(nagmessage, "Pick a Size") as num|null var/new_size = input(nagmessage, "Pick a Size") as num|null
if(new_size && IsInRange(new_size,25,200)) if(new_size && ISINRANGE(new_size,25,200))
src.resize(new_size/100) src.resize(new_size/100)
message_admins("[key_name(src)] used the resize command in-game to be [new_size]% size. \ message_admins("[key_name(src)] used the resize command in-game to be [new_size]% size. \
([src ? "<a href='?_src_=holder;adminplayerobservecoodjump=1;X=[src.x];Y=[src.y];Z=[src.z]'>JMP</a>" : "null"])") ([src ? "<a href='?_src_=holder;adminplayerobservecoodjump=1;X=[src.x];Y=[src.y];Z=[src.z]'>JMP</a>" : "null"])")

View File

@@ -72,12 +72,12 @@ var/datum/planet/virgo3b/planet_virgo3b = null
high_color = "#FFFFFF" high_color = "#FFFFFF"
min = 0.70 min = 0.70
var/lerp_weight = (abs(min - sun_position)) * 4 var/interpolate_weight = (abs(min - sun_position)) * 4
var/weather_light_modifier = 1 var/weather_light_modifier = 1
if(weather_holder && weather_holder.current_weather) if(weather_holder && weather_holder.current_weather)
weather_light_modifier = weather_holder.current_weather.light_modifier weather_light_modifier = weather_holder.current_weather.light_modifier
var/new_brightness = (Interpolate(low_brightness, high_brightness, weight = lerp_weight) ) * weather_light_modifier var/new_brightness = (LERP(low_brightness, high_brightness, interpolate_weight) ) * weather_light_modifier
var/new_color = null var/new_color = null
if(weather_holder && weather_holder.current_weather && weather_holder.current_weather.light_color) if(weather_holder && weather_holder.current_weather && weather_holder.current_weather.light_color)
@@ -93,9 +93,9 @@ var/datum/planet/virgo3b/planet_virgo3b = null
var/high_g = high_color_list[2] var/high_g = high_color_list[2]
var/high_b = high_color_list[3] var/high_b = high_color_list[3]
var/new_r = Interpolate(low_r, high_r, weight = lerp_weight) var/new_r = LERP(low_r, high_r, interpolate_weight)
var/new_g = Interpolate(low_g, high_g, weight = lerp_weight) var/new_g = LERP(low_g, high_g, interpolate_weight)
var/new_b = Interpolate(low_b, high_b, weight = lerp_weight) var/new_b = LERP(low_b, high_b, interpolate_weight)
new_color = rgb(new_r, new_g, new_b) new_color = rgb(new_r, new_g, new_b)

View File

@@ -93,11 +93,7 @@
#include "code\_helpers\icons_vr.dm" #include "code\_helpers\icons_vr.dm"
#include "code\_helpers\lists.dm" #include "code\_helpers\lists.dm"
#include "code\_helpers\logging.dm" #include "code\_helpers\logging.dm"
<<<<<<< HEAD:vorestation.dme
#include "code\_helpers\logging_vr.dm" #include "code\_helpers\logging_vr.dm"
#include "code\_helpers\maths.dm"
=======
>>>>>>> 8da11c1... Makes math helpers defines for performance (#5654):polaris.dme
#include "code\_helpers\matrices.dm" #include "code\_helpers\matrices.dm"
#include "code\_helpers\mobs.dm" #include "code\_helpers\mobs.dm"
#include "code\_helpers\names.dm" #include "code\_helpers\names.dm"