Merge remote-tracking branch 'upstream-polaris/master' into polaris-sync-2018-02-07

# Conflicts:
#	code/__defines/subsystems.dm
#	code/controllers/master_controller.dm
#	code/controllers/subsystems/atoms.dm
#	code/game/machinery/Sleeper.dm
#	code/game/machinery/doors/airlock.dm
#	code/game/machinery/vr_console.dm
#	code/game/objects/items/devices/communicator/phone.dm
#	code/game/turfs/flooring/flooring_decals.dm
#	code/modules/admin/admin_verbs.dm
#	code/modules/mob/living/carbon/carbon.dm
#	code/modules/multiz/movement.dm
#	code/modules/projectiles/gun.dm
#	code/modules/shuttles/shuttle.dm
#	code/modules/shuttles/shuttles_web.dm
#	icons/obj/doors/doormed.dmi
#	maps/southern_cross/items/headset_sc.dm
#	maps/southern_cross/southern_cross-3.dmm
#	vorestation.dme
This commit is contained in:
Leshana
2018-02-07 19:30:50 -05:00
179 changed files with 1959 additions and 1011 deletions
+53 -3
View File
@@ -51,6 +51,7 @@
attack_verb = list("struck", "hit", "bashed")
zoomdevicename = "scope"
var/automatic = 0
var/burst = 1
var/fire_delay = 6 //delay after shooting before the gun can be used again
var/burst_delay = 2 //delay between shots, if firing in bursts
@@ -68,7 +69,8 @@
var/requires_two_hands
var/wielded_icon = "gun_wielded"
var/one_handed_penalty = 0 // Penalty applied if someone fires a two-handed gun with one hand.
var/obj/screen/auto_target/auto_target
var/shooting = 0
var/next_fire_time = 0
var/sel_mode = 1 //index of the currently selected mode
@@ -180,8 +182,9 @@
if(P)
if(process_projectile(P, user, user, pick("l_foot", "r_foot")))
handle_post_fire(user, user)
var/datum/gender/TU = gender_datums[user.get_visible_gender()]
user.visible_message(
"<span class='danger'>\The [user] shoots \himself in the foot with \the [src]!</span>",
"<span class='danger'>\The [user] shoots [TU.himself] in the foot with \the [src]!</span>",
"<span class='danger'>You shoot yourself in the foot with \the [src]!</span>"
)
M.drop_item()
@@ -206,8 +209,29 @@
if(user && user.a_intent == I_HELP && user.is_preference_enabled(/datum/client_preference/safefiring)) //regardless of what happens, refuse to shoot if help intent is on
user << "<span class='warning'>You refrain from firing your [src] as your intent is set to help.</span>"
return
else
Fire(A,user,params) //Otherwise, fire normally.
Fire(A, user, params) //Otherwise, fire normally.
return
/* //Commented out for quality control and testing
if(automatic == 1)//Are we are going to be using automatic shooting
//We check to make sure they can fire
if(!special_check(user))
return
if(auto_target)//If they already have one then update it
auto_target.loc = get_turf(A)
auto_target.delay_del = 1//And reset the del so its like they got a new one and doesnt instantly vanish
to_chat(user, "<span class='notice'>You ready \the [src]! Click and drag the target around to shoot.</span>")
else//Otherwise just make a new one
auto_target = new/obj/screen/auto_target(get_turf(A), src)
visible_message("<span class='danger'>\[user] readies the [src]!</span>")
playsound(src, 'sound/weapons/TargetOn.ogg', 50, 1)
to_chat(user, "<span class='notice'>You ready \the [src]! Click and drag the target around to shoot.</span>")
return
Fire(A,user,params) //Otherwise, fire normally.
*/
/obj/item/weapon/gun/attack(atom/A, mob/living/user, def_zone)
if (A == user && user.zone_sel.selecting == O_MOUTH && !mouthshoot)
@@ -307,8 +331,11 @@
return
var/shoot_time = (burst - 1)* burst_delay
//These should apparently be disabled to allow for the automatic system to function without causing near-permanant paralysis. Re-enabling them while we sort that out.
user.setClickCooldown(shoot_time) //no clicking on things while shooting
user.setMoveCooldown(shoot_time) //no moving while shooting either
next_fire_time = world.time + shoot_time
var/held_acc_mod = 0
@@ -320,7 +347,27 @@
//actually attempt to shoot
var/turf/targloc = get_turf(target) //cache this in case target gets deleted during shooting, e.g. if it was a securitron that got destroyed.
/* // Commented out for quality control and testing.
shooting = 1
if(automatic == 1 && auto_target && auto_target.active)//When we are going to shoot and have an auto_target AND its active meaning we clicked on it we tell it to burstfire 1000 rounds
burst = 1000//Yes its not EXACTLY full auto but when are we shooting more than 1000 normally and it can easily be made higher
*/
for(var/i in 1 to burst)
/* // Commented out for quality control and testing.
if(!reflex && automatic)//If we are shooting automatic then check our target, however if we are shooting reflex we dont use automatic
//extra sanity checking.
if(user.incapacitated())
return
if(user.get_active_hand() != src)
break
if(!auto_target) break//Stopped shooting
else if(auto_target.loc)
target = auto_target.loc
//Lastly just update our dir if needed
if(user.dir != get_dir(user, auto_target))
user.face_atom(auto_target)
*/
var/obj/projectile = consume_next_projectile(user)
if(!projectile)
handle_click_empty(user)
@@ -346,6 +393,9 @@
last_shot = world.time
/* // Commented out for quality control and testing.
shooting = 0
*/
// We do this down here, so we don't get the message if we fire an empty gun.
if(requires_two_hands)
if(user.item_is_in_hands(src) && user.hands_are_full())
@@ -0,0 +1,73 @@
//This entire file is unticked for quality control and testing
//True automagic gun modes. Dakka dakka.
//A significant portion of this code was donated by Mport from SS:CM
//This is used by guns shooting in automatic mode
/obj/screen/auto_target
name = "targeter"
icon = null//We dont want people to see this guy
density = 0
anchored = 1
var/obj/item/weapon/gun/gun
var/active = 0//Just tells us that it was clicked on so we should start shooting
var/delay_del = 0//Delays the del if we retarget without shooting
/obj/screen/auto_target/New(loc, var/obj/item/weapon/gun/G)
..()
gun = G
var/image/I = image('icons/effects/Targeted.dmi', src, "locked")
I.override = 1
usr << I
//autodel() //Currently doesn't really work right.
return
/obj/screen/auto_target/CanPass()//Everything should ignore this guy and just pass by
return 1
//Used to get rid of this if they target but dont actually shoot or stop shooting (no ammo) yet are still dragging us around
/obj/screen/auto_target/proc/autodel()
set waitfor=0
if(active == 1)
return
sleep(20)
if(!src) return//Might not really be needed
if(delay_del)//This says we want to wait another X seconds before trying to del
delay_del = 0
autodel()
return
if(gun.shooting == 0)
qdel(src)
else
autodel()//Yes in theory this could hit the inf loop
return
//When the player clicks on the target it will disable the autodel and tell the gun to shoot
/obj/screen/auto_target/MouseDown(location,control,params)
active += 1//Tell the autodel that we are actually using this now
if(gun.shooting == 0)//If we are not shooting start shooting, we need this here or they have to drag to a new turf before it starts shooting, felt weird
gun.Fire(loc, usr, params)
return
//Called when they drag the object somewhere else
//If its not already shooting (should be though due to the above, but this does let it click at you when it runs dry) then start shooting,
/obj/screen/auto_target/MouseDrag(over_object,src_location,over_location,src_control,over_control,params)
if(gun.shooting == 0)//If we are not shooting start shooting
gun.Fire(loc, usr, params)
if(over_location != loc)//This updates the loc to our new location when we drag it to a new turf
loc = over_location
if((usr.get_active_hand() != gun))
qdel(src)
//This gets rid of us when they let go of the click, but only after they actually drag the target to a new turf which is why the below also has to exist
/obj/screen/auto_target/MouseDrop(over_object,src_location,over_location,src_control,over_control,params)
qdel(src)
return
//This is needed so if they just MouseDown and then let go it will stop shooting, otherwise we stick around till they run out of bullets
/obj/screen/auto_target/MouseUp(object,location,control,params)
qdel(src)
return
//This pseudo code is being left in place to serve as references to the modifications to gun.dm, the Fire() proc, and the afterattack() proc. -k22
//Code donated by Mport.
@@ -25,6 +25,16 @@
charge_cost = 480
projectile_type = /obj/item/projectile/ion
/obj/item/weapon/gun/energy/phasegun
name = "phase pistol"
desc = "The NT Mk26 EW Apollo is an energy handgun, specifically designed for use against wildlife."
icon_state = "phase"
item_state = "taser" //I don't have an in-hand sprite, taser will be fine
slot_flags = SLOT_BELT|SLOT_HOLSTER
charge_cost = 300
projectile_type = /obj/item/projectile/energy/phase
/obj/item/weapon/gun/energy/decloner
name = "biological demolecularisor"
desc = "A gun that discharges high amounts of controlled radiation to slowly break a target into component elements."
@@ -199,5 +209,5 @@ obj/item/weapon/gun/energy/staff/focus
firemodes = list(
list(mode_name="single shot", burst = 1, burst_accuracy = list(5), dispersion = list(0), charge_cost = 24),
list(mode_name="five shot burst", burst = 5, burst_accuracy = list(5,5,5,5,5), dispersion = list(1,1,1,1,1)),
list(mode_name="ten shot burst", burst = 10, burst_accuracy = list(5,5,5,5,5,5,5,5,5,5), dispersion = list(2,2,2,2,2,2,2,2,2,2)),
)
list(mode_name="ten shot burst", burst = 10, burst_accuracy = list(5,5,5,5,5,5,5,5,5,5), dispersion = list(2,2,2,2,2,2,2,2,2,2))
)
@@ -0,0 +1,174 @@
//This will likely drive me insane, but fuck it. Let's give it a shot. -k22
//This was heavily assisted by MoondancerPony
/obj/item/weapon/gun/energy/modular
name = "modular weapon"
desc = "You shouldn't be seeing this. Contact your local time-police station."
icon_state = "mod_pistol"
cell_type = /obj/item/weapon/cell/device/weapon
charge_cost = 120
var/max_components = 3 //How many components we can hold.
var/capacitor_rating = 0 //How good are the capacitors inside us?
var/laser_rating = 0 //How good are the lasers inside of us?
var/manipulator_rating = 0 //How good are the manipulators inside us?
var/assembled = 1 //Are we closed up?
var/max_burst_size = 5 //Don't let our maximum burst size get too high.
var/list/guncomponents = list() //Generate our list of components.
var/accepted_components = list(
/obj/item/weapon/stock_parts/capacitor/,
/obj/item/weapon/stock_parts/capacitor/adv,
/obj/item/weapon/stock_parts/capacitor/super,
/obj/item/weapon/stock_parts/micro_laser/,
/obj/item/weapon/stock_parts/micro_laser/high,
/obj/item/weapon/stock_parts/micro_laser/ultra,
/obj/item/weapon/stock_parts/manipulator/,
/obj/item/weapon/stock_parts/manipulator/nano,
/obj/item/weapon/stock_parts/manipulator/pico,
)
//Excessively long because it won't accept subtypes for some reason!
/obj/item/weapon/gun/energy/modular/New() //Initialize our components.
..()
guncomponents = list()
guncomponents += new /obj/item/weapon/stock_parts/capacitor
guncomponents += new /obj/item/weapon/stock_parts/micro_laser
guncomponents += new /obj/item/weapon/stock_parts/manipulator
CheckParts()
FireModeModify()
/obj/item/weapon/gun/energy/modular/proc/CheckParts() //What parts do we have inside us, and how good are they?
capacitor_rating = 0
laser_rating = 0
manipulator_rating = 0
for(var/obj/item/weapon/stock_parts/capacitor/CA in guncomponents)
capacitor_rating += CA.rating
for(var/obj/item/weapon/stock_parts/micro_laser/ML in guncomponents)
laser_rating += ML.rating
for(var/obj/item/weapon/stock_parts/manipulator/MA in guncomponents)
manipulator_rating += MA.rating
FireModeModify()
/obj/item/weapon/gun/energy/modular/attackby(obj/item/O, mob/user)
if(istype(O, /obj/item/weapon/screwdriver))
to_chat(user, "<span class='notice'>You [assembled ? "disassemble" : "assemble"] the gun.</span>")
assembled = !assembled
playsound(src, O.usesound, 50, 1)
return
if(istype(O, /obj/item/weapon/crowbar))
if(assembled == 1)
to_chat(user, "<span class='warning'>Disassemble the [src] first!</span>")
return
for(var/obj/item/I in guncomponents)
to_chat(user, "<span class='notice'>You remove the gun's components.</span>")
playsound(src, O.usesound, 50, 1)
I.forceMove(get_turf(src))
guncomponents.Remove(I)
CheckParts()
return
//Someone's attacking us, and it's not anything we have a special case for (i.e. a tool)
..()
if(assembled) // can't put anything in
return
if(!(O.type in accepted_components))//check if we can accept it
to_chat(user, "<span class='warning'>You can't add this to [src]!</span>")
return
if(guncomponents.len >= max_components) //We have too many componenets and can't fit more.
to_chat(user, "<span class='warning'>You can't add any more components!</span>")
return
if(istype(O, /obj/item/weapon/stock_parts/capacitor) && capacitor_rating == 5)
to_chat(user, "<span class='warning'>You can't add any more capacitors!</span>")
return
user.drop_item()
guncomponents += O
O.forceMove(src)
to_chat(user, "<span class='notice'>You add a component to the [src]</span>")
CheckParts()
/obj/item/weapon/gun/energy/modular/proc/FireModeModify() //Check our laser, manipulator, and capacitor ratings, adjust stun and lethal firemodes depending on laser / manipulator rating and burst size depending on capacitors.
//check our lethal and stun ratings depending on laser and manipulator rating.
var/burstmode = capacitor_rating
var/beammode
var/beammode_lethal
var/chargecost
var/chargecost_lethal
if(laser_rating >= 15)
beammode_lethal = /obj/item/projectile/beam/sniper
beammode = /obj/item/projectile/beam/stun
chargecost = 300
chargecost_lethal = 600
else if(laser_rating >= 10)
beammode_lethal = /obj/item/projectile/beam/xray
beammode = /obj/item/projectile/beam/stun
chargecost = 300
chargecost_lethal = 200
else if(laser_rating == 8 && manipulator_rating == 5) //very specific set of combinations. No, you can't make a pulse rifle. Sorry research.
beammode_lethal = /obj/item/projectile/beam/heavylaser
beammode = /obj/item/projectile/beam/stun
chargecost = 300
chargecost_lethal = 600
else if(laser_rating >= 5)
beammode_lethal = /obj/item/projectile/beam/midlaser
beammode = /obj/item/projectile/beam/stun/med
chargecost = 180
chargecost_lethal = 240
else if(laser_rating < 5)
beammode_lethal = /obj/item/projectile/beam/weaklaser
beammode = /obj/item/projectile/beam/stun/weak
chargecost = 100
chargecost_lethal = 200
firemodes = list(
new /datum/firemode(src, list(mode_name="stun", projectile_type=beammode, fire_sound='sound/weapons/Taser.ogg', charge_cost = chargecost)),
new /datum/firemode(src, list(mode_name="lethal", projectile_type=beammode_lethal, fire_sound='sound/weapons/Laser.ogg', charge_cost = chargecost_lethal)),
new /datum/firemode(src, list(mode_name="[burstmode] shot stun", projectile_type=beammode, fire_sound='sound/weapons/Taser.ogg', charge_cost = chargecost, burst = burstmode)),
new /datum/firemode(src, list(mode_name="[burstmode] shot lethal", projectile_type=beammode_lethal, fire_sound='sound/weapons/Laser.ogg', charge_cost = chargecost_lethal, burst = burstmode)),
)
/obj/item/weapon/gun/energy/modular/load_ammo(var/obj/item/C, mob/user)
if(istype(C, cell_type))
if(self_recharge || battery_lock)
user << "<span class='notice'>[src] does not have a battery port.</span>"
return
var/obj/item/weapon/cell/P = C
if(power_supply)
user << "<span class='notice'>[src] already has a power cell.</span>"
else
user.visible_message("[user] is reloading [src].", "<span class='notice'>You start to insert [P] into [src].</span>")
if(do_after(user, 10))
user.remove_from_mob(P)
power_supply = P
P.loc = src
user.visible_message("[user] inserts [P] into [src].", "<span class='notice'>You insert [P] into [src].</span>")
playsound(src.loc, 'sound/weapons/flipblade.ogg', 50, 1)
update_icon()
update_held_icon()
return
/obj/item/weapon/gun/energy/modular/pistol
name = "modular pistol"
icon_state = "mod_pistol"
max_components = 6
desc = "A bulky modular pistol frame. This only only accepts six parts."
origin_tech = list(TECH_COMBAT = 3, TECH_MAGNET = 3)
burst_delay = 2
/obj/item/weapon/gun/energy/modular/carbine
name = "modular carbine"
icon_state = "mod_carbine"
max_components = 8
desc = "A modular version of the standard laser carbine. This one can hold 8 components."
origin_tech = list(TECH_COMBAT = 4, TECH_MAGNET = 3, TECH_MATERIAL = 3)
burst_delay = 2
/obj/item/weapon/gun/energy/modular/cannon
name = "modular cannon"
icon_state = "mod_cannon"
max_components = 14
desc = "Say hello, to my little friend!"
one_handed_penalty = 4 //dual wielding = no.
cell_type = /obj/item/weapon/cell //We're bigger. We can use much larger power cells.
origin_tech = list(TECH_COMBAT = 6, TECH_MAGNET = 6, TECH_MATERIAL = 5, TECH_BLUESPACE = 4) //its a damn cannon capable of holding a huge amount of parts.
burst_delay = 4 //preventing extreme silliness.
@@ -190,14 +190,23 @@
one_handed_penalty = 6
var/cover_open = 0
/* Commented out for quality control and testing.
firemodes = list(
list(mode_name="semiauto", burst=1, fire_delay=0, move_delay=null, burst_accuracy=null, dispersion=null, automatic = 0),
list(mode_name="3-round bursts", burst=3, fire_delay=null, move_delay=4, burst_accuracy=list(0,-1,-1), dispersion=list(0.0, 0.6, 1.0), automatic = 0),
list(mode_name="short bursts", burst=5, move_delay=6, burst_accuracy = list(0,-1,-1,-2,-2), dispersion = list(0.6, 1.0, 1.0, 1.0, 1.2), automatic = 0),
list(mode_name="automatic", burst=1, fire_delay=-1, move_delay=null, burst_accuracy=null, dispersion=null, automatic = 1),
)
*/
firemodes = list(
list(mode_name="semiauto", burst=1, fire_delay=0, move_delay=null, burst_accuracy=null, dispersion=null),
list(mode_name="3-round bursts", burst=3, fire_delay=null, move_delay=4, burst_accuracy=list(0,-1,-1), dispersion=list(0.0, 0.6, 1.0)),
list(mode_name="short bursts", burst=5, move_delay=6, burst_accuracy = list(0,-1,-1,-2,-2), dispersion = list(0.6, 1.0, 1.0, 1.0, 1.2))
list(mode_name="short bursts", burst=5, move_delay=6, burst_accuracy = list(0,-1,-1,-2,-2), dispersion = list(0.6, 1.0, 1.0, 1.0, 1.2)),
)
var/cover_open = 0
/obj/item/weapon/gun/projectile/automatic/l6_saw/special_check(mob/user)
if(cover_open)
user << "<span class='warning'>[src]'s cover is open! Close it before firing!</span>"
@@ -370,4 +379,4 @@
icon_state = "bullpup"
else
item_state = "bullpup-empty"
if(!ignore_inhands) update_held_icon()
if(!ignore_inhands) update_held_icon()
@@ -195,4 +195,10 @@
light_color = "#0000FF"
embed_chance = 0
muzzle_type = /obj/effect/projectile/pulse/muzzle
muzzle_type = /obj/effect/projectile/pulse/muzzle
/obj/item/projectile/energy/phase
kill_count = 4
damage = 5
SA_bonus_damage = 55 // 60 total on animals.
SA_vulnerability = SA_ANIMAL
@@ -121,8 +121,9 @@
if(prob(15))
M.apply_effect((rand(30,80)),IRRADIATE)
M.Weaken(5)
var/datum/gender/TM = gender_datums[M.get_visible_gender()]
for (var/mob/V in viewers(src))
V.show_message("<font color='red'>[M] writhes in pain as \his vacuoles boil.</font>", 3, "<font color='red'>You hear the crunching of leaves.</font>", 2)
V.show_message("<font color='red'>[M] writhes in pain as [TM.his] vacuoles boil.</font>", 3, "<font color='red'>You hear the crunching of leaves.</font>", 2)
if(prob(35))
// for (var/mob/V in viewers(src)) //Public messages commented out to prevent possible metaish genetics experimentation and stuff. - Cheridan
// V.show_message("<font color='red'>[M] is mutated by the radiation beam.</font>", 3, "<font color='red'> You hear the snapping of twigs.</font>", 2)