Merge branch 'master' into upstream-merge-33470
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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()
|
||||
. = ..()
|
||||
|
||||
@@ -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]"
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 = ""
|
||||
|
||||
@@ -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.")
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -637,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>")
|
||||
@@ -647,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)
|
||||
|
||||
@@ -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."
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -241,7 +241,7 @@
|
||||
container_type = NONE
|
||||
else
|
||||
to_chat(user, "<span class='notice'>[src] can now be attached, modified, and refuelled.</span>")
|
||||
container_type = OPENCONTAINER
|
||||
container_type = OPENCONTAINER_1
|
||||
add_fingerprint(user)
|
||||
|
||||
/obj/item/weldingtool/proc/flamethrower_rods(obj/item/I, mob/user)
|
||||
|
||||
@@ -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", 60, 1)
|
||||
playsound(src, "gun_dry_fire", 30, 1)
|
||||
return
|
||||
playsound(user, 'sound/weapons/gunshot.ogg', 100, 1)
|
||||
src.bullets--
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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] = "#"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 ..()
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user