mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-10 09:54:52 +00:00
up to upstream-merge-27868
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
/client
|
||||
var/list/atom/selected_target[2]
|
||||
var/obj/item/active_mousedown_item = null
|
||||
var/mouseParams = ""
|
||||
var/mouseLocation = null
|
||||
var/mouseObject = null
|
||||
var/mouseControlObject = null
|
||||
|
||||
/client/MouseDown(object, location, control, params)
|
||||
var/delay = mob.CanMobAutoclick(object, location, params)
|
||||
@@ -9,14 +14,26 @@
|
||||
while(selected_target[1])
|
||||
Click(selected_target[1], location, control, selected_target[2])
|
||||
sleep(delay)
|
||||
active_mousedown_item = mob.canMobMousedown(object, location, params)
|
||||
if(active_mousedown_item)
|
||||
active_mousedown_item.onMouseDown(object, location, params, mob)
|
||||
|
||||
/client/MouseUp(object, location, control, params)
|
||||
selected_target[1] = null
|
||||
if(active_mousedown_item)
|
||||
active_mousedown_item.onMouseUp(object, location, params, mob)
|
||||
active_mousedown_item = null
|
||||
|
||||
/client/MouseDrag(src_object,atom/over_object,src_location,over_location,src_control,over_control,params)
|
||||
mouseParams = params
|
||||
mouseLocation = over_location
|
||||
mouseObject = over_object
|
||||
mouseControlObject = over_control
|
||||
if(selected_target[1] && over_object && over_object.IsAutoclickable())
|
||||
selected_target[1] = over_object
|
||||
selected_target[2] = params
|
||||
if(active_mousedown_item)
|
||||
active_mousedown_item.onMouseDrag(src_object, over_object, src_location, over_location, params, mob)
|
||||
|
||||
/mob/proc/CanMobAutoclick(object, location, params)
|
||||
|
||||
@@ -27,8 +44,31 @@
|
||||
if(h)
|
||||
. = h.CanItemAutoclick(object, location, params)
|
||||
|
||||
/mob/proc/canMobMousedown(object, location, params)
|
||||
|
||||
/mob/living/carbon/canMobMousedown(atom/object, location, params)
|
||||
var/obj/item/H = get_active_held_item()
|
||||
if(H)
|
||||
. = H.canItemMouseDown(object, location, params)
|
||||
|
||||
/obj/item/proc/CanItemAutoclick(object, location, params)
|
||||
|
||||
/obj/item/proc/canItemMouseDown(object, location, params)
|
||||
if(canMouseDown)
|
||||
return src
|
||||
|
||||
/obj/item/proc/onMouseDown(object, location, params, mob)
|
||||
return
|
||||
|
||||
/obj/item/proc/onMouseUp(object, location, params, mob)
|
||||
return
|
||||
|
||||
/obj/item/proc/onMouseDrag(src_object, over_object, src_location, over_location, params, mob)
|
||||
return
|
||||
|
||||
/obj/item
|
||||
var/canMouseDown = FALSE
|
||||
|
||||
/obj/item/weapon/gun
|
||||
var/automatic = 0 //can gun use it, 0 is no, anything above 0 is the delay between clicks in ds
|
||||
|
||||
@@ -43,3 +83,10 @@
|
||||
|
||||
/obj/screen/click_catcher/IsAutoclickable()
|
||||
. = 1
|
||||
|
||||
//Please don't roast me too hard
|
||||
/client/MouseMove(object,location,control,params)
|
||||
mouseParams = params
|
||||
mouseLocation = location
|
||||
mouseObject = object
|
||||
mouseControlObject = control
|
||||
|
||||
@@ -679,3 +679,7 @@
|
||||
set waitfor = FALSE
|
||||
if(!anchored && has_gravity())
|
||||
step(src, movedir)
|
||||
|
||||
//Returns an atom's power cell, if it has one. Overload for individual items.
|
||||
/atom/movable/proc/get_cell()
|
||||
return
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
if(charge)
|
||||
. = min(charge, 250)
|
||||
charge = use(.)
|
||||
updateicon()
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/light/power_drain(clockcult_user)
|
||||
if(on)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
S.update_icon()
|
||||
S.power_change()
|
||||
|
||||
var/list/skipped_areas = list(/area/engine/engineering, /area/ai_monitored/turret_protected/ai)
|
||||
var/list/skipped_areas = list(/area/engine/engineering, /area/engine/supermatter, /area/engine/atmospherics_engine, /area/ai_monitored/turret_protected/ai)
|
||||
|
||||
for(var/area/A in world)
|
||||
if( !A.requires_power || A.always_unpowered )
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
|
||||
|
||||
/obj/machinery/cell_charger/proc/removecell()
|
||||
charging.updateicon()
|
||||
charging.update_icon()
|
||||
charging = null
|
||||
chargelevel = -1
|
||||
updateicon()
|
||||
|
||||
@@ -925,181 +925,3 @@
|
||||
on = 0
|
||||
spawn(100)
|
||||
on = 1
|
||||
|
||||
/////// MANNED TURRET ////////
|
||||
|
||||
/obj/machinery/manned_turret
|
||||
name = "machine gun turret"
|
||||
desc = "While the trigger is held down, this gun will redistribute recoil to allow its user to easily shift targets."
|
||||
icon = 'icons/obj/turrets.dmi'
|
||||
icon_state = "machinegun"
|
||||
can_buckle = TRUE
|
||||
density = TRUE
|
||||
max_integrity = 100
|
||||
obj_integrity = 100
|
||||
buckle_lying = 0
|
||||
layer = ABOVE_MOB_LAYER
|
||||
var/view_range = 10
|
||||
var/cooldown = 0
|
||||
var/projectile_type = /obj/item/projectile/bullet/weakbullet3
|
||||
var/rate_of_fire = 1
|
||||
var/number_of_shots = 40
|
||||
var/cooldown_duration = 90
|
||||
var/atom/target
|
||||
var/turf/target_turf
|
||||
var/warned = FALSE
|
||||
var/mouseparams
|
||||
|
||||
//BUCKLE HOOKS
|
||||
|
||||
/obj/machinery/manned_turret/unbuckle_mob(mob/living/buckled_mob,force = 0)
|
||||
playsound(src,'sound/mecha/mechmove01.ogg', 50, 1)
|
||||
for(var/obj/item/I in buckled_mob.held_items)
|
||||
if(istype(I, /obj/item/gun_control))
|
||||
qdel(I)
|
||||
if(istype(buckled_mob))
|
||||
buckled_mob.pixel_x = 0
|
||||
buckled_mob.pixel_y = 0
|
||||
if(buckled_mob.client)
|
||||
buckled_mob.client.change_view(world.view)
|
||||
anchored = FALSE
|
||||
. = ..()
|
||||
|
||||
/obj/machinery/manned_turret/user_buckle_mob(mob/living/M, mob/living/carbon/user)
|
||||
if(user.incapacitated() || !istype(user))
|
||||
return
|
||||
M.forceMove(get_turf(src))
|
||||
..()
|
||||
for(var/V in M.held_items)
|
||||
var/obj/item/I = V
|
||||
if(istype(I))
|
||||
if(M.dropItemToGround(I))
|
||||
var/obj/item/gun_control/TC = new /obj/item/gun_control(src)
|
||||
M.put_in_hands(TC)
|
||||
else //Entries in the list should only ever be items or null, so if it's not an item, we can assume it's an empty hand
|
||||
var/obj/item/gun_control/TC = new /obj/item/gun_control(src)
|
||||
M.put_in_hands(TC)
|
||||
M.pixel_y = 14
|
||||
layer = ABOVE_MOB_LAYER
|
||||
setDir(SOUTH)
|
||||
playsound(src,'sound/mecha/mechmove01.ogg', 50, 1)
|
||||
anchored = TRUE
|
||||
if(user.client)
|
||||
user.client.change_view(view_range)
|
||||
|
||||
/obj/item/gun_control
|
||||
name = "turret controls"
|
||||
icon = 'icons/obj/weapons.dmi'
|
||||
icon_state = "offhand"
|
||||
w_class = WEIGHT_CLASS_HUGE
|
||||
flags = ABSTRACT | NODROP | NOBLUDGEON
|
||||
resistance_flags = FIRE_PROOF | UNACIDABLE | ACID_PROOF
|
||||
var/obj/machinery/manned_turret/turret
|
||||
|
||||
/obj/item/gun_control/New(obj/machinery/manned_turret/MT)
|
||||
if(MT)
|
||||
turret = MT
|
||||
else
|
||||
qdel(src)
|
||||
|
||||
/obj/item/gun_control/CanItemAutoclick()
|
||||
return 1
|
||||
|
||||
/obj/item/gun_control/attack_obj(obj/O, mob/living/user)
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
O.attacked_by(src, user)
|
||||
|
||||
/obj/item/gun_control/attack(mob/living/M, mob/living/user)
|
||||
user.lastattacked = M
|
||||
M.lastattacker = user
|
||||
M.attacked_by(src, user)
|
||||
add_fingerprint(user)
|
||||
|
||||
/obj/item/gun_control/afterattack(atom/targeted_atom, mob/user, flag, params)
|
||||
..()
|
||||
var/obj/machinery/manned_turret/E = user.buckled
|
||||
E.setDir(get_dir(E,targeted_atom))
|
||||
user.setDir(E.dir)
|
||||
E.mouseparams = params
|
||||
switch(E.dir)
|
||||
if(NORTH)
|
||||
E.layer = BELOW_MOB_LAYER
|
||||
user.pixel_x = 0
|
||||
user.pixel_y = -14
|
||||
if(NORTHEAST)
|
||||
E.layer = BELOW_MOB_LAYER
|
||||
user.pixel_x = -8
|
||||
user.pixel_y = -4
|
||||
if(EAST)
|
||||
E.layer = ABOVE_MOB_LAYER
|
||||
user.pixel_x = -14
|
||||
user.pixel_y = 0
|
||||
if(SOUTHEAST)
|
||||
E.layer = BELOW_MOB_LAYER
|
||||
user.pixel_x = -8
|
||||
user.pixel_y = 4
|
||||
if(SOUTH)
|
||||
E.layer = ABOVE_MOB_LAYER
|
||||
user.pixel_x = 0
|
||||
user.pixel_y = 14
|
||||
if(SOUTHWEST)
|
||||
E.layer = BELOW_MOB_LAYER
|
||||
user.pixel_x = 8
|
||||
user.pixel_y = 4
|
||||
if(WEST)
|
||||
E.layer = ABOVE_MOB_LAYER
|
||||
user.pixel_x = 14
|
||||
user.pixel_y = 0
|
||||
if(NORTHWEST)
|
||||
E.layer = BELOW_MOB_LAYER
|
||||
user.pixel_x = 8
|
||||
user.pixel_y = -4
|
||||
E.checkfire(targeted_atom, user)
|
||||
|
||||
/obj/machinery/manned_turret/proc/checkfire(atom/targeted_atom, mob/user)
|
||||
target = targeted_atom
|
||||
if(target == user || target == get_turf(src))
|
||||
return
|
||||
if(world.time < cooldown)
|
||||
if(!warned && world.time > (cooldown - cooldown_duration + rate_of_fire*number_of_shots)) // To capture the window where one is done firing
|
||||
warned = TRUE
|
||||
playsound(src, 'sound/weapons/sear.ogg', 100, 1)
|
||||
return
|
||||
else
|
||||
cooldown = world.time + cooldown_duration
|
||||
warned = FALSE
|
||||
volley(user)
|
||||
|
||||
/obj/machinery/manned_turret/proc/volley(mob/user)
|
||||
target_turf = get_turf(target)
|
||||
for(var/i in 1 to number_of_shots)
|
||||
addtimer(CALLBACK(src, /obj/machinery/manned_turret/.proc/fire_helper, user), i*rate_of_fire)
|
||||
|
||||
|
||||
/obj/machinery/manned_turret/proc/fire_helper(mob/user)
|
||||
if(!src)
|
||||
return
|
||||
var/turf/targets_from = get_turf(src)
|
||||
if(QDELETED(target))
|
||||
target = target_turf
|
||||
var/obj/item/projectile/P = new projectile_type(targets_from)
|
||||
P.current = targets_from
|
||||
P.starting = targets_from
|
||||
P.firer = user
|
||||
P.original = target
|
||||
playsound(src, 'sound/weapons/Gunshot_smg.ogg', 75, 1)
|
||||
P.preparePixelProjectile(target, target_turf, user, mouseparams, rand(-9, 9))
|
||||
P.fire()
|
||||
|
||||
/obj/machinery/manned_turret/ultimate // Admin-only proof of concept for autoclicker automatics
|
||||
name = "Infinity Gun"
|
||||
view_range = 12
|
||||
projectile_type = /obj/item/projectile/bullet/weakbullet3
|
||||
|
||||
|
||||
/obj/machinery/manned_turret/ultimate/checkfire(atom/targeted_atom, mob/user)
|
||||
target = targeted_atom
|
||||
if(target == user || target == get_turf(src))
|
||||
return
|
||||
target_turf = get_turf(target)
|
||||
fire_helper(user)
|
||||
|
||||
@@ -108,41 +108,25 @@
|
||||
|
||||
var/using_power = 0
|
||||
if(charging)
|
||||
if(istype(charging, /obj/item/weapon/gun/energy))
|
||||
var/obj/item/weapon/gun/energy/E = charging
|
||||
if(E.power_supply.charge < E.power_supply.maxcharge)
|
||||
E.power_supply.give(E.power_supply.chargerate * recharge_coeff)
|
||||
E.recharge_newshot()
|
||||
var/obj/item/weapon/stock_parts/cell/C = charging.get_cell()
|
||||
if(C)
|
||||
if(C.charge < C.maxcharge)
|
||||
C.give(C.chargerate * recharge_coeff)
|
||||
use_power(250 * recharge_coeff)
|
||||
using_power = 1
|
||||
|
||||
|
||||
if(istype(charging, /obj/item/weapon/melee/baton))
|
||||
var/obj/item/weapon/melee/baton/B = charging
|
||||
if(B.bcell)
|
||||
if(B.bcell.give(B.bcell.chargerate * recharge_coeff))
|
||||
use_power(200 * recharge_coeff)
|
||||
using_power = 1
|
||||
|
||||
update_icon(using_power)
|
||||
if(istype(charging, /obj/item/weapon/gun/energy))
|
||||
var/obj/item/weapon/gun/energy/E = charging
|
||||
E.recharge_newshot()
|
||||
return
|
||||
if(istype(charging, /obj/item/ammo_box/magazine/recharge))
|
||||
var/obj/item/ammo_box/magazine/recharge/R = charging
|
||||
if(R.stored_ammo.len < R.max_ammo)
|
||||
R.stored_ammo += new R.ammo_type(R)
|
||||
use_power(200 * recharge_coeff)
|
||||
using_power = 1
|
||||
|
||||
if(istype(charging, /obj/item/device/modular_computer))
|
||||
var/obj/item/device/modular_computer/C = charging
|
||||
var/obj/item/weapon/computer_hardware/battery/battery_module = C.all_components[MC_CELL]
|
||||
if(battery_module)
|
||||
var/obj/item/weapon/computer_hardware/battery/B = battery_module
|
||||
if(B.battery)
|
||||
if(B.battery.charge < B.battery.maxcharge)
|
||||
B.battery.give(B.battery.chargerate * recharge_coeff)
|
||||
use_power(200 * recharge_coeff)
|
||||
using_power = 1
|
||||
|
||||
update_icon(using_power)
|
||||
return
|
||||
|
||||
/obj/machinery/recharger/power_change()
|
||||
..()
|
||||
@@ -152,13 +136,13 @@
|
||||
if(!(stat & (NOPOWER|BROKEN)) && anchored)
|
||||
if(istype(charging, /obj/item/weapon/gun/energy))
|
||||
var/obj/item/weapon/gun/energy/E = charging
|
||||
if(E.power_supply)
|
||||
E.power_supply.emp_act(severity)
|
||||
if(E.cell)
|
||||
E.cell.emp_act(severity)
|
||||
|
||||
else if(istype(charging, /obj/item/weapon/melee/baton))
|
||||
var/obj/item/weapon/melee/baton/B = charging
|
||||
if(B.bcell)
|
||||
B.bcell.charge = 0
|
||||
if(B.cell)
|
||||
B.cell.charge = 0
|
||||
..()
|
||||
|
||||
|
||||
|
||||
@@ -24,6 +24,9 @@
|
||||
var/settableTemperatureMedian = 30 + T0C
|
||||
var/settableTemperatureRange = 30
|
||||
|
||||
/obj/machinery/space_heater/get_cell()
|
||||
return cell
|
||||
|
||||
/obj/machinery/space_heater/New()
|
||||
..()
|
||||
cell = new(src)
|
||||
|
||||
@@ -142,6 +142,9 @@
|
||||
diag_hud_set_mechstat()
|
||||
diag_hud_set_mechtracking()
|
||||
|
||||
/obj/mecha/get_cell()
|
||||
return cell
|
||||
|
||||
|
||||
/obj/mecha/Destroy()
|
||||
go_out()
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
var/safety = 1 //if you can zap people with the defibs on harm mode
|
||||
var/powered = 0 //if there's a cell in the defib with enough power for a revive, blocks paddles from reviving otherwise
|
||||
var/obj/item/weapon/twohanded/shockpaddles/paddles
|
||||
var/obj/item/weapon/stock_parts/cell/high/bcell = null
|
||||
var/obj/item/weapon/stock_parts/cell/high/cell
|
||||
var/combat = 0 //can we revive through space suits?
|
||||
var/grab_ghost = FALSE // Do we pull the ghost back into their body?
|
||||
|
||||
@@ -29,10 +29,13 @@
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/item/weapon/defibrillator/get_cell()
|
||||
return cell
|
||||
|
||||
/obj/item/weapon/defibrillator/loaded/Initialize() //starts with hicap
|
||||
. = ..()
|
||||
paddles = make_paddles()
|
||||
bcell = new(src)
|
||||
cell = new(src)
|
||||
update_icon()
|
||||
return
|
||||
|
||||
@@ -42,8 +45,8 @@
|
||||
update_charge()
|
||||
|
||||
/obj/item/weapon/defibrillator/proc/update_power()
|
||||
if(bcell)
|
||||
if(bcell.charge < paddles.revivecost)
|
||||
if(cell)
|
||||
if(cell.charge < paddles.revivecost)
|
||||
powered = 0
|
||||
else
|
||||
powered = 1
|
||||
@@ -56,21 +59,21 @@
|
||||
add_overlay("[initial(icon_state)]-paddles")
|
||||
if(powered)
|
||||
add_overlay("[initial(icon_state)]-powered")
|
||||
if(!bcell)
|
||||
if(!cell)
|
||||
add_overlay("[initial(icon_state)]-nocell")
|
||||
if(!safety)
|
||||
add_overlay("[initial(icon_state)]-emagged")
|
||||
|
||||
/obj/item/weapon/defibrillator/proc/update_charge()
|
||||
if(powered) //so it doesn't show charge if it's unpowered
|
||||
if(bcell)
|
||||
var/ratio = bcell.charge / bcell.maxcharge
|
||||
if(cell)
|
||||
var/ratio = cell.charge / cell.maxcharge
|
||||
ratio = Ceiling(ratio*4) * 25
|
||||
add_overlay("[initial(icon_state)]-charge[ratio]")
|
||||
|
||||
/obj/item/weapon/defibrillator/CheckParts(list/parts_list)
|
||||
..()
|
||||
bcell = locate(/obj/item/weapon/stock_parts/cell) in contents
|
||||
cell = locate(/obj/item/weapon/stock_parts/cell) in contents
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/defibrillator/ui_action_click()
|
||||
@@ -105,7 +108,7 @@
|
||||
toggle_paddles()
|
||||
else if(istype(W, /obj/item/weapon/stock_parts/cell))
|
||||
var/obj/item/weapon/stock_parts/cell/C = W
|
||||
if(bcell)
|
||||
if(cell)
|
||||
to_chat(user, "<span class='notice'>[src] already has a cell.</span>")
|
||||
else
|
||||
if(C.maxcharge < paddles.revivecost)
|
||||
@@ -113,15 +116,15 @@
|
||||
return
|
||||
if(!user.transferItemToLoc(W, src))
|
||||
return
|
||||
bcell = W
|
||||
cell = W
|
||||
to_chat(user, "<span class='notice'>You install a cell in [src].</span>")
|
||||
update_icon()
|
||||
|
||||
else if(istype(W, /obj/item/weapon/screwdriver))
|
||||
if(bcell)
|
||||
bcell.updateicon()
|
||||
bcell.loc = get_turf(src.loc)
|
||||
bcell = null
|
||||
if(cell)
|
||||
cell.update_icon()
|
||||
cell.loc = get_turf(src.loc)
|
||||
cell = null
|
||||
to_chat(user, "<span class='notice'>You remove the cell from [src].</span>")
|
||||
update_icon()
|
||||
else
|
||||
@@ -136,7 +139,7 @@
|
||||
to_chat(user, "<span class='notice'>You silently enable [src]'s safety protocols with the cryptographic sequencer.")
|
||||
|
||||
/obj/item/weapon/defibrillator/emp_act(severity)
|
||||
if(bcell)
|
||||
if(cell)
|
||||
deductcharge(1000 / severity)
|
||||
if(safety)
|
||||
safety = 0
|
||||
@@ -200,11 +203,11 @@
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/defibrillator/proc/deductcharge(chrgdeductamt)
|
||||
if(bcell)
|
||||
if(bcell.charge < (paddles.revivecost+chrgdeductamt))
|
||||
if(cell)
|
||||
if(cell.charge < (paddles.revivecost+chrgdeductamt))
|
||||
powered = 0
|
||||
update_icon()
|
||||
if(bcell.use(chrgdeductamt))
|
||||
if(cell.use(chrgdeductamt))
|
||||
update_icon()
|
||||
return 1
|
||||
else
|
||||
@@ -213,8 +216,8 @@
|
||||
|
||||
/obj/item/weapon/defibrillator/proc/cooldowncheck(mob/user)
|
||||
spawn(50)
|
||||
if(bcell)
|
||||
if(bcell.charge >= paddles.revivecost)
|
||||
if(cell)
|
||||
if(cell.charge >= paddles.revivecost)
|
||||
user.visible_message("<span class='notice'>[src] beeps: Unit ready.</span>")
|
||||
playsound(get_turf(src), 'sound/machines/defib_ready.ogg', 50, 0)
|
||||
else
|
||||
@@ -240,7 +243,7 @@
|
||||
/obj/item/weapon/defibrillator/compact/loaded/Initialize()
|
||||
. = ..()
|
||||
paddles = make_paddles()
|
||||
bcell = new(src)
|
||||
cell = new(src)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/defibrillator/compact/combat
|
||||
@@ -252,7 +255,7 @@
|
||||
/obj/item/weapon/defibrillator/compact/combat/loaded/Initialize()
|
||||
. = ..()
|
||||
paddles = make_paddles()
|
||||
bcell = new /obj/item/weapon/stock_parts/cell/infinite(src)
|
||||
cell = new /obj/item/weapon/stock_parts/cell/infinite(src)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/defibrillator/compact/combat/loaded/attackby(obj/item/weapon/W, mob/user, params)
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
var/stunforce = 7
|
||||
var/status = 0
|
||||
var/obj/item/weapon/stock_parts/cell/high/bcell = null
|
||||
var/obj/item/weapon/stock_parts/cell/high/cell = null
|
||||
var/hitcost = 1000
|
||||
var/throw_hit_chance = 35
|
||||
|
||||
@@ -32,15 +32,15 @@
|
||||
baton_stun(hit_atom)
|
||||
|
||||
/obj/item/weapon/melee/baton/loaded/Initialize() //this one starts with a cell pre-installed.
|
||||
bcell = new(src)
|
||||
cell = new(src)
|
||||
. = ..()
|
||||
|
||||
/obj/item/weapon/melee/baton/proc/deductcharge(chrgdeductamt)
|
||||
if(bcell)
|
||||
if(cell)
|
||||
//Note this value returned is significant, as it will determine
|
||||
//if a stun is applied or not
|
||||
. = bcell.use(chrgdeductamt)
|
||||
if(status && bcell.charge < hitcost)
|
||||
. = cell.use(chrgdeductamt)
|
||||
if(status && cell.charge < hitcost)
|
||||
//we're below minimum, turn off
|
||||
status = 0
|
||||
update_icon()
|
||||
@@ -50,22 +50,22 @@
|
||||
/obj/item/weapon/melee/baton/update_icon()
|
||||
if(status)
|
||||
icon_state = "[initial(name)]_active"
|
||||
else if(!bcell)
|
||||
else if(!cell)
|
||||
icon_state = "[initial(name)]_nocell"
|
||||
else
|
||||
icon_state = "[initial(name)]"
|
||||
|
||||
/obj/item/weapon/melee/baton/examine(mob/user)
|
||||
..()
|
||||
if(bcell)
|
||||
to_chat(user, "<span class='notice'>The baton is [round(bcell.percent())]% charged.</span>")
|
||||
if(cell)
|
||||
to_chat(user, "<span class='notice'>The baton is [round(cell.percent())]% charged.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>The baton does not have a power source installed.</span>")
|
||||
|
||||
/obj/item/weapon/melee/baton/attackby(obj/item/weapon/W, mob/user, params)
|
||||
if(istype(W, /obj/item/weapon/stock_parts/cell))
|
||||
var/obj/item/weapon/stock_parts/cell/C = W
|
||||
if(bcell)
|
||||
if(cell)
|
||||
to_chat(user, "<span class='notice'>[src] already has a cell.</span>")
|
||||
else
|
||||
if(C.maxcharge < hitcost)
|
||||
@@ -73,15 +73,15 @@
|
||||
return
|
||||
if(!user.transferItemToLoc(W, src))
|
||||
return
|
||||
bcell = W
|
||||
cell = W
|
||||
to_chat(user, "<span class='notice'>You install a cell in [src].</span>")
|
||||
update_icon()
|
||||
|
||||
else if(istype(W, /obj/item/weapon/screwdriver))
|
||||
if(bcell)
|
||||
bcell.updateicon()
|
||||
bcell.loc = get_turf(src.loc)
|
||||
bcell = null
|
||||
if(cell)
|
||||
cell.update_icon()
|
||||
cell.forceMove(get_turf(src))
|
||||
cell = null
|
||||
to_chat(user, "<span class='notice'>You remove the cell from [src].</span>")
|
||||
status = 0
|
||||
update_icon()
|
||||
@@ -89,13 +89,13 @@
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/melee/baton/attack_self(mob/user)
|
||||
if(bcell && bcell.charge > hitcost)
|
||||
if(cell && cell.charge > hitcost)
|
||||
status = !status
|
||||
to_chat(user, "<span class='notice'>[src] is now [status ? "on" : "off"].</span>")
|
||||
playsound(loc, "sparks", 75, 1, -1)
|
||||
else
|
||||
status = 0
|
||||
if(!bcell)
|
||||
if(!cell)
|
||||
to_chat(user, "<span class='warning'>[src] does not have a power source!</span>")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>[src] is out of charge.</span>")
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
/obj/item/weapon/melee/baton/cattleprod/attackby(obj/item/I, mob/user, params)//handles sticking a crystal onto a stunprod to make a teleprod
|
||||
if(istype(I, /obj/item/weapon/ore/bluespace_crystal))
|
||||
if(!bcell)
|
||||
if(!cell)
|
||||
var/obj/item/weapon/melee/baton/cattleprod/teleprod/S = new /obj/item/weapon/melee/baton/cattleprod/teleprod
|
||||
remove_item_from_storage(user)
|
||||
qdel(src)
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
new /obj/item/clothing/glasses/meson/engine(src)
|
||||
new /obj/item/weapon/door_remote/chief_engineer(src)
|
||||
new /obj/item/weapon/pipe_dispenser(src)
|
||||
new /obj/item/weapon/inducer(src)
|
||||
|
||||
/obj/structure/closet/secure_closet/engineering_electrical
|
||||
name = "electrical supplies locker"
|
||||
@@ -37,6 +38,8 @@
|
||||
..()
|
||||
new /obj/item/clothing/gloves/color/yellow(src)
|
||||
new /obj/item/clothing/gloves/color/yellow(src)
|
||||
new /obj/item/weapon/inducer(src)
|
||||
new /obj/item/weapon/inducer(src)
|
||||
for(var/i in 1 to 3)
|
||||
new /obj/item/weapon/storage/toolbox/electrical(src)
|
||||
for(var/i in 1 to 3)
|
||||
|
||||
@@ -480,8 +480,8 @@
|
||||
|
||||
if(istype(O, /obj/item/weapon/melee/baton))
|
||||
var/obj/item/weapon/melee/baton/B = O
|
||||
if(B.bcell)
|
||||
if(B.bcell.charge > 0 && B.status == 1)
|
||||
if(B.cell)
|
||||
if(B.cell.charge > 0 && B.status == 1)
|
||||
flick("baton_active", src)
|
||||
var/stunforce = B.stunforce
|
||||
user.Stun(stunforce)
|
||||
|
||||
@@ -14,9 +14,10 @@
|
||||
if(type == INDIVIDUAL_SHOW_ALL_LOG)
|
||||
dat += "<center>Displaying all logs of [key_name(M)]</center><br><hr>"
|
||||
for(var/log_type in M.logging)
|
||||
var/list/reversed = M.logging[log_type]
|
||||
reversed = reverseRange(reversed.Copy())
|
||||
dat += "<center><b>[log_type]</b></center><br>"
|
||||
var/list/reversed = M.logging[log_type]
|
||||
if(islist(reversed))
|
||||
reversed = reverseRange(reversed.Copy())
|
||||
for(var/entry in reversed)
|
||||
dat += "<font size=2px>[entry]: [reversed[entry]]</font><br>"
|
||||
dat += "<hr>"
|
||||
@@ -26,6 +27,6 @@
|
||||
if(reversed)
|
||||
reversed = reverseRange(reversed.Copy())
|
||||
for(var/entry in reversed)
|
||||
dat += "<font size=2px>[entry]: [reversed[entry]]</font><br>"
|
||||
dat += "<font size=2px>[entry]: [reversed[entry]]</font><hr>"
|
||||
|
||||
usr << browse(dat, "window=invidual_logging;size=600x480")
|
||||
usr << browse(dat, "window=invidual_logging_[M];size=600x480")
|
||||
|
||||
@@ -13,6 +13,14 @@
|
||||
icon_state = "filter_off_f"
|
||||
flipped = 1
|
||||
|
||||
// These two filter types have critical_machine flagged to on and thus causes the area they are in to be exempt from the Grid Check event.
|
||||
|
||||
/obj/machinery/atmospherics/components/trinary/filter/critical
|
||||
critical_machine = TRUE
|
||||
|
||||
/obj/machinery/atmospherics/components/trinary/filter/flipped/critical
|
||||
critical_machine = TRUE
|
||||
|
||||
/obj/machinery/atmospherics/components/trinary/filter/proc/set_frequency(new_frequency)
|
||||
SSradio.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
|
||||
@@ -543,6 +543,13 @@
|
||||
crate_name = "electrical maintenance crate"
|
||||
crate_type = /obj/structure/closet/crate/engineering/electrical
|
||||
|
||||
/datum/supply_pack/engineering/inducers
|
||||
name = "NT-75 Electromagnetic Power Inducers Crate"
|
||||
cost = 2000
|
||||
contains = list(/obj/item/weapon/inducer/sci {cell_type = /obj/item/weapon/stock_parts/cell/{maxcharge = 5000; charge = 5000};opened = 0},/obj/item/weapon/inducer/sci {cell_type = /obj/item/weapon/stock_parts/cell/{maxcharge = 5000; charge = 5000};opened = 0}) //FALSE doesn't work in modified type paths apparently.
|
||||
crate_name = "inducer crate"
|
||||
crate_type = /obj/structure/closet/crate/engineering/electrical
|
||||
|
||||
/datum/supply_pack/engineering/engiequipment
|
||||
name = "Engineering Gear Crate"
|
||||
cost = 1300
|
||||
|
||||
@@ -1540,7 +1540,7 @@
|
||||
if(stunning && stunCheck.stunned)
|
||||
shouldFire = 0
|
||||
if(shouldFire)
|
||||
if(P.power_supply.charge <= 10) // can shoot seems to bug out for tasers, using this hacky method instead
|
||||
if(P.cell.charge <= 10) // can shoot seems to bug out for tasers, using this hacky method instead
|
||||
P.update_icon()
|
||||
npcDrop(P,1)
|
||||
else
|
||||
|
||||
@@ -97,6 +97,9 @@
|
||||
buckle_lying = FALSE
|
||||
can_ride_typecache = list(/mob/living/carbon/human)
|
||||
|
||||
/mob/living/silicon/robot/get_cell()
|
||||
return cell
|
||||
|
||||
/mob/living/silicon/robot/Initialize(mapload)
|
||||
spark_system = new /datum/effect_system/spark_spread()
|
||||
spark_system.set_up(5, 0, src)
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
add_fingerprint(user)
|
||||
if(opened && !wiresexposed && !issilicon(user))
|
||||
if(cell)
|
||||
cell.updateicon()
|
||||
cell.update_icon()
|
||||
cell.add_fingerprint(user)
|
||||
user.put_in_active_hand(cell)
|
||||
to_chat(user, "<span class='notice'>You remove \the [cell].</span>")
|
||||
|
||||
@@ -149,8 +149,8 @@
|
||||
F.update_icon()
|
||||
else if(istype(I, /obj/item/weapon/melee/baton))
|
||||
var/obj/item/weapon/melee/baton/B = I
|
||||
if(B.bcell)
|
||||
B.bcell.charge = B.bcell.maxcharge
|
||||
if(B.cell)
|
||||
B.cell.charge = B.cell.maxcharge
|
||||
else if(istype(I, /obj/item/weapon/gun/energy))
|
||||
var/obj/item/weapon/gun/energy/EG = I
|
||||
if(!EG.chambered)
|
||||
@@ -395,9 +395,9 @@
|
||||
..()
|
||||
var/obj/item/weapon/gun/energy/e_gun/advtaser/cyborg/T = locate(/obj/item/weapon/gun/energy/e_gun/advtaser/cyborg) in basic_modules
|
||||
if(T)
|
||||
if(T.power_supply.charge < T.power_supply.maxcharge)
|
||||
if(T.cell.charge < T.cell.maxcharge)
|
||||
var/obj/item/ammo_casing/energy/S = T.ammo_type[T.select]
|
||||
T.power_supply.give(S.e_cost * coeff)
|
||||
T.cell.give(S.e_cost * coeff)
|
||||
T.update_icon()
|
||||
else
|
||||
T.charge_tick = 0
|
||||
|
||||
@@ -364,15 +364,15 @@ Auto Patrol[]"},
|
||||
|
||||
if(!lasercolor)
|
||||
var/obj/item/weapon/gun/energy/e_gun/advtaser/G = new /obj/item/weapon/gun/energy/e_gun/advtaser(Tsec)
|
||||
G.power_supply.charge = 0
|
||||
G.cell.charge = 0
|
||||
G.update_icon()
|
||||
else if(lasercolor == "b")
|
||||
var/obj/item/weapon/gun/energy/laser/bluetag/G = new /obj/item/weapon/gun/energy/laser/bluetag(Tsec)
|
||||
G.power_supply.charge = 0
|
||||
G.cell.charge = 0
|
||||
G.update_icon()
|
||||
else if(lasercolor == "r")
|
||||
var/obj/item/weapon/gun/energy/laser/redtag/G = new /obj/item/weapon/gun/energy/laser/redtag(Tsec)
|
||||
G.power_supply.charge = 0
|
||||
G.cell.charge = 0
|
||||
G.update_icon()
|
||||
|
||||
if(prob(50))
|
||||
|
||||
@@ -229,10 +229,10 @@ GLOBAL_LIST_INIT(protected_objects, list(/obj/structure/table, /obj/structure/ca
|
||||
|
||||
/mob/living/simple_animal/hostile/mimic/copy/ranged/OpenFire(the_target)
|
||||
if(Zapgun)
|
||||
if(Zapgun.power_supply)
|
||||
if(Zapgun.cell)
|
||||
var/obj/item/ammo_casing/energy/shot = Zapgun.ammo_type[Zapgun.select]
|
||||
if(Zapgun.power_supply.charge >= shot.e_cost)
|
||||
Zapgun.power_supply.use(shot.e_cost)
|
||||
if(Zapgun.cell.charge >= shot.e_cost)
|
||||
Zapgun.cell.use(shot.e_cost)
|
||||
Zapgun.update_icon()
|
||||
..()
|
||||
else if(Zapstick)
|
||||
|
||||
@@ -26,6 +26,11 @@
|
||||
return battery_module.battery.give(amount)
|
||||
return 0
|
||||
|
||||
/obj/item/device/modular_computer/get_cell()
|
||||
var/obj/item/weapon/computer_hardware/battery/battery_module = all_components[MC_CELL]
|
||||
if(battery_module && battery_module.battery)
|
||||
return battery_module.battery
|
||||
|
||||
|
||||
// Used in following function to reduce copypaste
|
||||
/obj/item/device/modular_computer/proc/power_failure()
|
||||
|
||||
@@ -111,7 +111,7 @@ They *could* go in their appropriate files, but this is supposed to be modular
|
||||
S.cell.charge += charge
|
||||
charge = 0
|
||||
corrupt()
|
||||
updateicon()
|
||||
update_icon()
|
||||
|
||||
|
||||
//RDCONSOLE//
|
||||
|
||||
@@ -56,6 +56,8 @@ Contents:
|
||||
var/s_bombs = 10//Number of starting ninja smoke bombs.
|
||||
var/a_boost = 3//Number of adrenaline boosters.
|
||||
|
||||
/obj/item/clothing/suit/space/space_ninja/get_cell()
|
||||
return cell
|
||||
|
||||
/obj/item/clothing/suit/space/space_ninja/New()
|
||||
..()
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
U.put_in_hands(old_cell)
|
||||
old_cell.add_fingerprint(U)
|
||||
old_cell.corrupt()
|
||||
old_cell.updateicon()
|
||||
old_cell.update_icon()
|
||||
cell = CELL
|
||||
to_chat(U, "<span class='notice'>Upgrade complete. Maximum capacity: <b>[round(cell.maxcharge/100)]</b>%</span>")
|
||||
else
|
||||
|
||||
@@ -93,6 +93,10 @@
|
||||
var/update_overlay = -1
|
||||
var/icon_update_needed = FALSE
|
||||
|
||||
/obj/machinery/power/apc/get_cell()
|
||||
return cell
|
||||
|
||||
|
||||
/obj/machinery/power/apc/connect_to_network()
|
||||
//Override because the APC does not directly connect to the network; it goes through a terminal.
|
||||
//The terminal is what the power computer looks for anyway.
|
||||
@@ -622,14 +626,10 @@
|
||||
return
|
||||
if(usr == user && opened && (!issilicon(user)))
|
||||
if(cell)
|
||||
user.visible_message("[user] removes \the [cell] from [src]!","<span class='notice'>You remove \the [cell].</span>")
|
||||
user.put_in_hands(cell)
|
||||
cell.add_fingerprint(user)
|
||||
cell.updateicon()
|
||||
|
||||
cell.update_icon()
|
||||
src.cell = null
|
||||
user.visible_message("[user.name] removes the power cell from [src.name]!",\
|
||||
"<span class='notice'>You remove the power cell.</span>")
|
||||
//to_chat(user, "You remove the power cell.")
|
||||
charging = 0
|
||||
src.update_icon()
|
||||
return
|
||||
|
||||
@@ -19,13 +19,16 @@
|
||||
var/ratingdesc = TRUE
|
||||
var/grown_battery = FALSE // If it's a grown that acts as a battery, add a wire overlay to it.
|
||||
|
||||
/obj/item/weapon/stock_parts/cell/get_cell()
|
||||
return src
|
||||
|
||||
/obj/item/weapon/stock_parts/cell/New()
|
||||
..()
|
||||
START_PROCESSING(SSobj, src)
|
||||
charge = maxcharge
|
||||
if(ratingdesc)
|
||||
desc += " This one has a power rating of [maxcharge], and you should not swallow it."
|
||||
updateicon()
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/stock_parts/cell/Destroy()
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
@@ -46,7 +49,7 @@
|
||||
else
|
||||
return PROCESS_KILL
|
||||
|
||||
/obj/item/weapon/stock_parts/cell/proc/updateicon()
|
||||
/obj/item/weapon/stock_parts/cell/update_icon()
|
||||
cut_overlays()
|
||||
if(grown_battery)
|
||||
add_overlay("grown_wires")
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
desc = "A basic energy-based gun."
|
||||
icon = 'icons/obj/guns/energy.dmi'
|
||||
|
||||
var/obj/item/weapon/stock_parts/cell/power_supply //What type of power cell this uses
|
||||
var/obj/item/weapon/stock_parts/cell/cell //What type of power cell this uses
|
||||
var/cell_type = /obj/item/weapon/stock_parts/cell
|
||||
var/modifystate = 0
|
||||
var/list/ammo_type = list(/obj/item/ammo_casing/energy)
|
||||
@@ -20,19 +20,22 @@
|
||||
var/use_cyborg_cell = 0 //whether the gun's cell drains the cyborg user's cell to recharge
|
||||
|
||||
/obj/item/weapon/gun/energy/emp_act(severity)
|
||||
power_supply.use(round(power_supply.charge / severity))
|
||||
cell.use(round(cell.charge / severity))
|
||||
chambered = null //we empty the chamber
|
||||
recharge_newshot() //and try to charge a new shot
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/gun/energy/get_cell()
|
||||
return cell
|
||||
|
||||
|
||||
/obj/item/weapon/gun/energy/Initialize()
|
||||
. = ..()
|
||||
if(cell_type)
|
||||
power_supply = new cell_type(src)
|
||||
cell = new cell_type(src)
|
||||
else
|
||||
power_supply = new(src)
|
||||
power_supply.give(power_supply.maxcharge)
|
||||
cell = new(src)
|
||||
cell.give(cell.maxcharge)
|
||||
update_ammo_types()
|
||||
recharge_newshot(1)
|
||||
if(selfcharge)
|
||||
@@ -50,9 +53,7 @@
|
||||
fire_delay = shot.delay
|
||||
|
||||
/obj/item/weapon/gun/energy/Destroy()
|
||||
if(power_supply)
|
||||
qdel(power_supply)
|
||||
power_supply = null
|
||||
QDEL_NULL(cell)
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
return ..()
|
||||
|
||||
@@ -62,9 +63,9 @@
|
||||
if(charge_tick < charge_delay)
|
||||
return
|
||||
charge_tick = 0
|
||||
if(!power_supply)
|
||||
if(!cell)
|
||||
return
|
||||
power_supply.give(100)
|
||||
cell.give(100)
|
||||
if(!chambered) //if empty chamber we try to charge a new shot
|
||||
recharge_newshot(1)
|
||||
update_icon()
|
||||
@@ -76,10 +77,10 @@
|
||||
|
||||
/obj/item/weapon/gun/energy/can_shoot()
|
||||
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
|
||||
return power_supply.charge >= shot.e_cost
|
||||
return cell.charge >= shot.e_cost
|
||||
|
||||
/obj/item/weapon/gun/energy/recharge_newshot(no_cyborg_drain)
|
||||
if (!ammo_type || !power_supply)
|
||||
if (!ammo_type || !cell)
|
||||
return
|
||||
if(use_cyborg_cell && !no_cyborg_drain)
|
||||
if(iscyborg(loc))
|
||||
@@ -87,10 +88,10 @@
|
||||
if(R.cell)
|
||||
var/obj/item/ammo_casing/energy/shot = ammo_type[select] //Necessary to find cost of shot
|
||||
if(R.cell.use(shot.e_cost)) //Take power from the borg...
|
||||
power_supply.give(shot.e_cost) //... to recharge the shot
|
||||
cell.give(shot.e_cost) //... to recharge the shot
|
||||
if(!chambered)
|
||||
var/obj/item/ammo_casing/energy/AC = ammo_type[select]
|
||||
if(power_supply.charge >= AC.e_cost) //if there's enough power in the power_supply cell...
|
||||
if(cell.charge >= AC.e_cost) //if there's enough power in the cell cell...
|
||||
chambered = AC //...prepare a new shot based on the current ammo type selected
|
||||
if(!chambered.BB)
|
||||
chambered.newshot()
|
||||
@@ -98,7 +99,7 @@
|
||||
/obj/item/weapon/gun/energy/process_chamber()
|
||||
if(chambered && !chambered.BB) //if BB is null, i.e the shot has been fired...
|
||||
var/obj/item/ammo_casing/energy/shot = chambered
|
||||
power_supply.use(shot.e_cost)//... drain the power_supply cell
|
||||
cell.use(shot.e_cost)//... drain the cell cell
|
||||
chambered = null //either way, released the prepared shot
|
||||
recharge_newshot() //try to charge a new shot
|
||||
|
||||
@@ -120,7 +121,7 @@
|
||||
..()
|
||||
if(!automatic_charge_overlays)
|
||||
return
|
||||
var/ratio = Ceiling((power_supply.charge / power_supply.maxcharge) * charge_sections)
|
||||
var/ratio = Ceiling((cell.charge / cell.maxcharge) * charge_sections)
|
||||
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
|
||||
var/iconState = "[icon_state]_charge"
|
||||
var/itemState = null
|
||||
@@ -131,7 +132,7 @@
|
||||
iconState += "_[shot.select_name]"
|
||||
if(itemState)
|
||||
itemState += "[shot.select_name]"
|
||||
if(power_supply.charge < shot.e_cost)
|
||||
if(cell.charge < shot.e_cost)
|
||||
add_overlay("[icon_state]_empty")
|
||||
else
|
||||
if(!shaded_charge)
|
||||
@@ -156,7 +157,7 @@
|
||||
user.visible_message("<span class='suicide'>[user] melts [user.p_their()] face off with [src]!</span>")
|
||||
playsound(loc, fire_sound, 50, 1, -1)
|
||||
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
|
||||
power_supply.use(shot.e_cost)
|
||||
cell.use(shot.e_cost)
|
||||
update_icon()
|
||||
return(FIRELOSS)
|
||||
else
|
||||
@@ -191,17 +192,17 @@
|
||||
user.visible_message("<span class='danger'>[user] tries to light their [A.name] with [src], but it doesn't do anything. Dumbass.</span>")
|
||||
playsound(user, E.fire_sound, 50, 1)
|
||||
playsound(user, BB.hitsound, 50, 1)
|
||||
power_supply.use(E.e_cost)
|
||||
cell.use(E.e_cost)
|
||||
. = ""
|
||||
else if(BB.damage_type != BURN)
|
||||
user.visible_message("<span class='danger'>[user] tries to light their [A.name] with [src], but only succeeds in utterly destroying it. Dumbass.</span>")
|
||||
playsound(user, E.fire_sound, 50, 1)
|
||||
playsound(user, BB.hitsound, 50, 1)
|
||||
power_supply.use(E.e_cost)
|
||||
cell.use(E.e_cost)
|
||||
qdel(A)
|
||||
. = ""
|
||||
else
|
||||
playsound(user, E.fire_sound, 50, 1)
|
||||
playsound(user, BB.hitsound, 50, 1)
|
||||
power_supply.use(E.e_cost)
|
||||
cell.use(E.e_cost)
|
||||
. = "<span class='danger'>[user] casually lights their [A.name] with [src]. Damn.</span>"
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
empty()
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/empty()
|
||||
power_supply.use(500)
|
||||
cell.use(500)
|
||||
update_icon()
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/attempt_reload(recharge_time)
|
||||
@@ -125,7 +125,7 @@
|
||||
return
|
||||
|
||||
/obj/item/weapon/gun/energy/kinetic_accelerator/proc/reload()
|
||||
power_supply.give(500)
|
||||
cell.give(500)
|
||||
recharge_newshot(1)
|
||||
if(!suppressed)
|
||||
playsound(src.loc, 'sound/weapons/kenetic_reload.ogg', 60, 1)
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
/obj/item/weapon/gun/energy/decloner/update_icon()
|
||||
..()
|
||||
var/obj/item/ammo_casing/energy/shot = ammo_type[select]
|
||||
if(power_supply.charge > shot.e_cost)
|
||||
if(cell.charge > shot.e_cost)
|
||||
add_overlay("decloner_spin")
|
||||
|
||||
/obj/item/weapon/gun/energy/floragun
|
||||
@@ -137,19 +137,19 @@
|
||||
|
||||
/obj/item/weapon/gun/energy/plasmacutter/examine(mob/user)
|
||||
..()
|
||||
if(power_supply)
|
||||
to_chat(user, "<span class='notice'>[src] is [round(power_supply.percent())]% charged.</span>")
|
||||
if(cell)
|
||||
to_chat(user, "<span class='notice'>[src] is [round(cell.percent())]% charged.</span>")
|
||||
|
||||
/obj/item/weapon/gun/energy/plasmacutter/attackby(obj/item/A, mob/user)
|
||||
if(istype(A, /obj/item/stack/sheet/mineral/plasma))
|
||||
var/obj/item/stack/sheet/S = A
|
||||
S.use(1)
|
||||
power_supply.give(1000)
|
||||
cell.give(1000)
|
||||
recharge_newshot(1)
|
||||
to_chat(user, "<span class='notice'>You insert [A] in [src], recharging it.</span>")
|
||||
else if(istype(A, /obj/item/weapon/ore/plasma))
|
||||
qdel(A)
|
||||
power_supply.give(500)
|
||||
cell.give(500)
|
||||
recharge_newshot(1)
|
||||
to_chat(user, "<span class='notice'>You insert [A] in [src], recharging it.</span>")
|
||||
else
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
return "chest"
|
||||
|
||||
/obj/item/projectile/proc/prehit(atom/target)
|
||||
return
|
||||
return TRUE
|
||||
|
||||
/obj/item/projectile/proc/on_hit(atom/target, blocked = 0)
|
||||
var/turf/target_loca = get_turf(target)
|
||||
@@ -142,7 +142,7 @@
|
||||
if(firer && !ricochets)
|
||||
if(A == firer || (A == firer.loc && istype(A, /obj/mecha))) //cannot shoot yourself or your mech
|
||||
loc = A.loc
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
var/distance = get_dist(get_turf(A), starting) // Get the distance between the turf shot from and the mob we hit and use that for the calculations.
|
||||
def_zone = ran_zone(def_zone, max(100-(7*distance), 5)) //Lower accurancy/longer range tradeoff. 7 is a balanced number to use.
|
||||
@@ -155,13 +155,14 @@
|
||||
|
||||
var/turf/target_turf = get_turf(A)
|
||||
|
||||
prehit(A)
|
||||
if(!prehit(A))
|
||||
return FALSE
|
||||
var/permutation = A.bullet_act(src, def_zone) // searches for return value, could be deleted after run so check A isn't null
|
||||
if(permutation == -1 || forcedodge)// the bullet passes through a dense object!
|
||||
loc = target_turf
|
||||
if(A)
|
||||
permutated.Add(A)
|
||||
return 0
|
||||
return FALSE
|
||||
else
|
||||
if(A && A.density && !ismob(A) && !(A.flags & ON_BORDER)) //if we hit a dense non-border obj or dense turf then we also hit one of the mobs on that tile.
|
||||
var/list/mobs_list = list()
|
||||
@@ -169,9 +170,11 @@
|
||||
mobs_list += L
|
||||
if(mobs_list.len)
|
||||
var/mob/living/picked_mob = pick(mobs_list)
|
||||
prehit(picked_mob)
|
||||
if(!prehit(picked_mob))
|
||||
return FALSE
|
||||
picked_mob.bullet_act(src, def_zone)
|
||||
qdel(src)
|
||||
return TRUE
|
||||
|
||||
/obj/item/projectile/proc/check_ricochet()
|
||||
if(prob(ricochet_chance))
|
||||
@@ -277,21 +280,31 @@
|
||||
Range()
|
||||
sleep(config.run_speed * 0.9)
|
||||
|
||||
|
||||
/obj/item/projectile/proc/preparePixelProjectile(atom/target, var/turf/targloc, mob/living/user, params, spread)
|
||||
var/turf/curloc = get_turf(user)
|
||||
src.loc = get_turf(user)
|
||||
src.starting = get_turf(user)
|
||||
src.current = curloc
|
||||
src.yo = targloc.y - curloc.y
|
||||
src.xo = targloc.x - curloc.x
|
||||
forceMove(get_turf(user))
|
||||
starting = get_turf(user)
|
||||
current = curloc
|
||||
yo = targloc.y - curloc.y
|
||||
xo = targloc.x - curloc.x
|
||||
|
||||
if(params)
|
||||
var/list/calculated = calculate_projectile_angle_and_pixel_offsets(user, params)
|
||||
Angle = calculated[1]
|
||||
p_x = calculated[2]
|
||||
p_y = calculated[3]
|
||||
|
||||
if(spread)
|
||||
src.Angle += spread
|
||||
|
||||
/proc/calculate_projectile_angle_and_pixel_offsets(mob/user, params)
|
||||
var/list/mouse_control = params2list(params)
|
||||
var/p_x = 0
|
||||
var/p_y = 0
|
||||
var/angle = 0
|
||||
if(mouse_control["icon-x"])
|
||||
src.p_x = text2num(mouse_control["icon-x"])
|
||||
p_x = text2num(mouse_control["icon-x"])
|
||||
if(mouse_control["icon-y"])
|
||||
src.p_y = text2num(mouse_control["icon-y"])
|
||||
p_y = text2num(mouse_control["icon-y"])
|
||||
if(mouse_control["screen-loc"])
|
||||
//Split screen-loc up into X+Pixel_X and Y+Pixel_Y
|
||||
var/list/screen_loc_params = splittext(mouse_control["screen-loc"], ",")
|
||||
@@ -308,15 +321,12 @@
|
||||
//Calculate the "resolution" of screen based on client's view and world's icon size. This will work if the user can view more tiles than average.
|
||||
var/screenview = (user.client.view * 2 + 1) * world.icon_size //Refer to http://www.byond.com/docs/ref/info.html#/client/var/view for mad maths
|
||||
|
||||
var/ox = round(screenview/2) //"origin" x
|
||||
var/oy = round(screenview/2) //"origin" y
|
||||
var/ox = round(screenview/2) - user.client.pixel_x //"origin" x
|
||||
var/oy = round(screenview/2) - user.client.pixel_y //"origin" y
|
||||
// to_chat(world, "Pixel position: [x] [y]")
|
||||
var/angle = Atan2(y - oy, x - ox)
|
||||
angle = Atan2(y - oy, x - ox)
|
||||
// to_chat(world, "Angle: [angle]")
|
||||
src.Angle = angle
|
||||
if(spread)
|
||||
src.Angle += spread
|
||||
|
||||
return list(angle, p_x, p_y)
|
||||
|
||||
/obj/item/projectile/Crossed(atom/movable/AM) //A mob moving on a tile with a projectile is hit by it.
|
||||
..()
|
||||
|
||||
@@ -68,6 +68,17 @@
|
||||
build_path = /obj/item/device/lightreplacer
|
||||
category = list("Power Designs")
|
||||
|
||||
/datum/design/inducer
|
||||
name = "Inducer"
|
||||
desc = "The NT-75 Electromagnetic Power Inducer can wirelessly induce electric charge in an object, allowing you to recharge power cells without having to remove them."
|
||||
id = "inducer"
|
||||
req_tech = list("powerstorage" = 4, "engineering" = 4, "magnets" = 4)
|
||||
build_type = PROTOLATHE
|
||||
materials = list(MAT_METAL = 3000, MAT_GLASS = 1000)
|
||||
build_path = /obj/item/weapon/inducer/sci
|
||||
category = list("Power Designs")
|
||||
|
||||
|
||||
/datum/design/board/pacman
|
||||
name = "Machine Design (PACMAN-type Generator Board)"
|
||||
desc = "The circuit board that for a PACMAN-type portable generator."
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 131 KiB After Width: | Height: | Size: 131 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 129 KiB After Width: | Height: | Size: 129 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 12 KiB |
@@ -831,6 +831,7 @@
|
||||
#include "code\game\objects\items\weapons\his_grace.dm"
|
||||
#include "code\game\objects\items\weapons\holosign_creator.dm"
|
||||
#include "code\game\objects\items\weapons\holy_weapons.dm"
|
||||
#include "code\game\objects\items\weapons\inducer.dm"
|
||||
#include "code\game\objects\items\weapons\kitchen.dm"
|
||||
#include "code\game\objects\items\weapons\manuals.dm"
|
||||
#include "code\game\objects\items\weapons\miscellaneous.dm"
|
||||
@@ -932,6 +933,7 @@
|
||||
#include "code\game\objects\structures\ladders.dm"
|
||||
#include "code\game\objects\structures\lattice.dm"
|
||||
#include "code\game\objects\structures\life_candle.dm"
|
||||
#include "code\game\objects\structures\manned_turret.dm"
|
||||
#include "code\game\objects\structures\memorial.dm"
|
||||
#include "code\game\objects\structures\mineral_doors.dm"
|
||||
#include "code\game\objects\structures\mirror.dm"
|
||||
|
||||
Reference in New Issue
Block a user