up to upstream-merge-27868

This commit is contained in:
LetterJay
2017-06-11 00:04:00 -05:00
parent 4c8cf31f73
commit b80a184d97
39 changed files with 333 additions and 411 deletions

View File

@@ -14,11 +14,12 @@
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>"
for(var/entry in reversed)
dat += "<font size=2px>[entry]: [reversed[entry]]</font><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>"
else
dat += "<center>[type] of [key_name(M)]</center><br>"
@@ -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")

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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)

View File

@@ -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>")

View File

@@ -104,10 +104,10 @@
S.cost = 1
S.source = get_or_create_estorage(/datum/robot_energy_storage/wire)
else if(istype(S, /obj/item/stack/marker_beacon))
S.cost = 1
S.source = get_or_create_estorage(/datum/robot_energy_storage/beacon)
else if(istype(S, /obj/item/stack/marker_beacon))
S.cost = 1
S.source = get_or_create_estorage(/datum/robot_energy_storage/beacon)
if(S && S.source)
S.materials = list()
S.is_cyborg = 1
@@ -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)
@@ -202,9 +202,9 @@
/obj/item/weapon/robot_module/proc/do_transform_animation()
var/mob/living/silicon/robot/R = loc
R.notransform = TRUE
var/obj/effect/temp_visual/decoy/fading/fivesecond/ANM = new /obj/effect/temp_visual/decoy/fading/fivesecond(R.loc, R)
var/obj/effect/temp_visual/decoy/fading/fivesecond/ANM = new /obj/effect/temp_visual/decoy/fading/fivesecond(R.loc, R)
ANM.layer = R.layer - 0.01
new /obj/effect/temp_visual/small_smoke(R.loc)
new /obj/effect/temp_visual/small_smoke(R.loc)
if(R.hat)
R.hat.forceMove(get_turf(R))
R.hat = null
@@ -226,7 +226,7 @@
if(R.hud_used)
R.hud_used.update_robot_modules_display()
if(feedback_key && !did_feedback)
SSblackbox.inc(feedback_key, 1)
SSblackbox.inc(feedback_key, 1)
/obj/item/weapon/robot_module/standard
name = "Standard"
@@ -275,7 +275,7 @@
/obj/item/roller/robo,
/obj/item/borg/cyborghug/medical,
/obj/item/stack/medical/gauze/cyborg,
/obj/item/weapon/organ_storage,
/obj/item/weapon/organ_storage,
/obj/item/borg/lollipop)
emag_modules = list(/obj/item/weapon/reagent_containers/borghypo/hacked)
ratvar_modules = list(
@@ -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
@@ -411,8 +411,8 @@
/obj/item/weapon/reagent_containers/borghypo/peace,
/obj/item/weapon/holosign_creator/cyborg,
/obj/item/borg/cyborghug/peacekeeper,
/obj/item/weapon/extinguisher,
/obj/item/borg/projectile_dampen)
/obj/item/weapon/extinguisher,
/obj/item/borg/projectile_dampen)
emag_modules = list(/obj/item/weapon/reagent_containers/borghypo/peace/hacked)
ratvar_modules = list(
/obj/item/clockwork/slab/cyborg/peacekeeper,
@@ -539,8 +539,8 @@
/obj/item/weapon/storage/bag/sheetsnatcher/borg,
/obj/item/device/t_scanner/adv_mining_scanner,
/obj/item/weapon/gun/energy/kinetic_accelerator/cyborg,
/obj/item/device/gps/cyborg,
/obj/item/stack/marker_beacon)
/obj/item/device/gps/cyborg,
/obj/item/stack/marker_beacon)
emag_modules = list(/obj/item/borg/stun)
ratvar_modules = list(
/obj/item/clockwork/slab/cyborg/miner,
@@ -636,8 +636,8 @@
max_energy = 2500
recharge_rate = 250
name = "Medical Synthesizer"
/datum/robot_energy_storage/beacon
max_energy = 30
recharge_rate = 1
name = "Marker Beacon Storage"
/datum/robot_energy_storage/beacon
max_energy = 30
recharge_rate = 1
name = "Marker Beacon Storage"

View File

@@ -9,7 +9,7 @@
maxHealth = 100
damage_coeff = list(BRUTE = 0.5, BURN = 0.7, TOX = 0, CLONE = 0, STAMINA = 0, OXY = 0)
obj_damage = 60
environment_smash = ENVIRONMENT_SMASH_WALLS //Walls can't stop THE LAW
environment_smash = ENVIRONMENT_SMASH_WALLS //Walls can't stop THE LAW
mob_size = MOB_SIZE_LARGE
radio_key = /obj/item/device/encryptionkey/headset_sec
@@ -358,21 +358,21 @@ Auto Patrol[]"},
var/obj/item/weapon/ed209_assembly/Sa = new /obj/item/weapon/ed209_assembly(Tsec)
Sa.build_step = 1
Sa.add_overlay("hs_hole")
Sa.add_overlay("hs_hole")
Sa.created_name = name
new /obj/item/device/assembly/prox_sensor(Tsec)
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))
@@ -390,7 +390,7 @@ Auto Patrol[]"},
if(lasercolor == "r")
new /obj/item/clothing/suit/redtag(Tsec)
do_sparks(3, TRUE, src)
do_sparks(3, TRUE, src)
new /obj/effect/decal/cleanable/oil(loc)
..()
@@ -444,7 +444,7 @@ Auto Patrol[]"},
if(severity==2 && prob(70))
..(severity-1)
else
new /obj/effect/temp_visual/emp(loc)
new /obj/effect/temp_visual/emp(loc)
var/list/mob/living/carbon/targets = new
for(var/mob/living/carbon/C in view(12,src))
if(C.stat==2)

View File

@@ -100,7 +100,7 @@ GLOBAL_LIST_INIT(protected_objects, list(/obj/structure/table, /obj/structure/ca
var/mob/living/creator = null // the creator
var/destroy_objects = 0
var/knockdown_people = 0
var/static/mutable_appearance/googly_eyes = mutable_appearance('icons/mob/mob.dmi', "googly_eyes")
var/static/mutable_appearance/googly_eyes = mutable_appearance('icons/mob/mob.dmi', "googly_eyes")
gold_core_spawnable = 0
/mob/living/simple_animal/hostile/mimic/copy/Initialize(mapload, obj/copy, mob/living/creator, destroy_original = 0)
@@ -203,7 +203,7 @@ GLOBAL_LIST_INIT(protected_objects, list(/obj/structure/table, /obj/structure/ca
if(..())
emote_see = list("aims menacingly")
obj_damage = 0
environment_smash = ENVIRONMENT_SMASH_NONE //needed? seems weird for them to do so
environment_smash = ENVIRONMENT_SMASH_NONE //needed? seems weird for them to do so
ranged = 1
retreat_distance = 1 //just enough to shoot
minimum_distance = 6
@@ -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)

View File

@@ -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()

View File

@@ -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//

View File

@@ -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()
..()

View File

@@ -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

View File

@@ -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

View File

@@ -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,16 +49,16 @@
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")
add_overlay("grown_wires")
if(charge < 0.01)
return
else if(charge/maxcharge >=0.995)
add_overlay("cell-o2")
add_overlay("cell-o2")
else
add_overlay("cell-o1")
add_overlay("cell-o1")
/obj/item/weapon/stock_parts/cell/proc/percent() // return % charge of cell
return 100*charge/maxcharge
@@ -69,7 +72,7 @@
return 0
charge = (charge - amount)
if(!istype(loc, /obj/machinery/power/apc))
SSblackbox.add_details("cell_used","[src.type]")
SSblackbox.add_details("cell_used","[src.type]")
return 1
// recharge the cell
@@ -123,7 +126,7 @@
corrupt()
return
//explosion(T, 0, 1, 2, 2)
explosion(T, devastation_range, heavy_impact_range, light_impact_range, flash_range)
explosion(T, devastation_range, heavy_impact_range, light_impact_range, flash_range)
qdel(src)
/obj/item/weapon/stock_parts/cell/proc/corrupt()

View File

@@ -4,13 +4,13 @@
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)
var/select = 1 //The state of the select fire switch. Determines from the ammo_type list what kind of shot is fired next.
var/can_charge = 1 //Can it be charged in a recharger?
var/automatic_charge_overlays = TRUE //Do we handle overlays with base update_icon()?
var/automatic_charge_overlays = TRUE //Do we handle overlays with base update_icon()?
var/charge_sections = 4
ammo_x_offset = 2
var/shaded_charge = 0 //if this gun uses a stateful charge bar for more detail
@@ -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()
. = ..()
/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
@@ -117,10 +118,10 @@
return
/obj/item/weapon/gun/energy/update_icon()
..()
if(!automatic_charge_overlays)
return
var/ratio = Ceiling((power_supply.charge / power_supply.maxcharge) * charge_sections)
..()
if(!automatic_charge_overlays)
return
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,16 +132,16 @@
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)
var/mutable_appearance/charge_overlay = mutable_appearance(icon, iconState)
var/mutable_appearance/charge_overlay = mutable_appearance(icon, iconState)
for(var/i = ratio, i >= 1, i--)
charge_overlay.pixel_x = ammo_x_offset * (i - 1)
add_overlay(charge_overlay)
charge_overlay.pixel_x = ammo_x_offset * (i - 1)
add_overlay(charge_overlay)
else
add_overlay("[icon_state]_charge[ratio]")
add_overlay("[icon_state]_charge[ratio]")
if(itemState)
itemState += "[ratio]"
item_state = itemState
@@ -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>"

View File

@@ -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)

View File

@@ -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

View File

@@ -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,46 +280,53 @@
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/mouse_control = params2list(params)
if(mouse_control["icon-x"])
src.p_x = text2num(mouse_control["icon-x"])
if(mouse_control["icon-y"])
src.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"], ",")
var/list/calculated = calculate_projectile_angle_and_pixel_offsets(user, params)
Angle = calculated[1]
p_x = calculated[2]
p_y = calculated[3]
//Split X+Pixel_X up into list(X, Pixel_X)
var/list/screen_loc_X = splittext(screen_loc_params[1],":")
//Split Y+Pixel_Y up into list(Y, Pixel_Y)
var/list/screen_loc_Y = splittext(screen_loc_params[2],":")
// to_chat(world, "X: [screen_loc_X[1]] PixelX: [screen_loc_X[2]] / Y: [screen_loc_Y[1]] PixelY: [screen_loc_Y[2]]")
var/x = text2num(screen_loc_X[1]) * 32 + text2num(screen_loc_X[2]) - 32
var/y = text2num(screen_loc_Y[1]) * 32 + text2num(screen_loc_Y[2]) - 32
//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
// to_chat(world, "Pixel position: [x] [y]")
var/angle = Atan2(y - oy, x - ox)
// to_chat(world, "Angle: [angle]")
src.Angle = angle
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"])
p_x = text2num(mouse_control["icon-x"])
if(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"], ",")
//Split X+Pixel_X up into list(X, Pixel_X)
var/list/screen_loc_X = splittext(screen_loc_params[1],":")
//Split Y+Pixel_Y up into list(Y, Pixel_Y)
var/list/screen_loc_Y = splittext(screen_loc_params[2],":")
// to_chat(world, "X: [screen_loc_X[1]] PixelX: [screen_loc_X[2]] / Y: [screen_loc_Y[1]] PixelY: [screen_loc_Y[2]]")
var/x = text2num(screen_loc_X[1]) * 32 + text2num(screen_loc_X[2]) - 32
var/y = text2num(screen_loc_Y[1]) * 32 + text2num(screen_loc_Y[2]) - 32
//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) - user.client.pixel_x //"origin" x
var/oy = round(screenview/2) - user.client.pixel_y //"origin" y
// to_chat(world, "Pixel position: [x] [y]")
angle = Atan2(y - oy, x - ox)
// to_chat(world, "Angle: [angle]")
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.
..()

View File

@@ -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."