Polaris Sync

This commit is contained in:
killer653
2017-10-16 22:16:24 -04:00
249 changed files with 6618 additions and 2568 deletions
@@ -0,0 +1,13 @@
/obj/item/weapon/magnetic_ammo
name = "flechette magazine"
desc = "A magazine containing steel flechettes."
icon = 'icons/obj/ammo.dmi'
icon_state = "5.56"
w_class = ITEMSIZE_SMALL
matter = list(DEFAULT_WALL_MATERIAL = 1800)
origin_tech = list(TECH_COMBAT = 1)
var/remaining = 9
/obj/item/weapon/magnetic_ammo/examine(mob/user)
. = ..()
to_chat(user, "There [(remaining == 1)? "is" : "are"] [remaining] flechette\s left!")
+8 -1
View File
@@ -515,7 +515,7 @@
damage_mult = 1.5
P.damage *= damage_mult
/obj/item/weapon/gun/proc/process_accuracy(obj/projectile, mob/user, atom/target, acc_mod, dispersion)
/obj/item/weapon/gun/proc/process_accuracy(obj/projectile, mob/living/user, atom/target, acc_mod, dispersion)
var/obj/item/projectile/P = projectile
if(!istype(P))
return //default behaviour only applies to true projectiles
@@ -539,6 +539,13 @@
//As opposed to no-delay pew pew
P.accuracy += 2
// Some modifiers make it harder or easier to hit things.
for(var/datum/modifier/M in user.modifiers)
if(!isnull(M.accuracy))
P.accuracy += M.accuracy
if(!isnull(M.accuracy_dispersion))
P.dispersion = max(P.dispersion + M.accuracy_dispersion, 0)
//does the actual launching of the projectile
/obj/item/weapon/gun/proc/process_projectile(obj/projectile, mob/user, atom/target, var/target_zone, var/params=null)
var/obj/item/projectile/P = projectile
+2 -1
View File
@@ -36,7 +36,7 @@
item_state = "crossbow"
origin_tech = list(TECH_COMBAT = 2, TECH_MAGNET = 2, TECH_ILLEGAL = 5)
matter = list(DEFAULT_WALL_MATERIAL = 2000)
slot_flags = SLOT_BELT
slot_flags = SLOT_BELT | SLOT_HOLSTER
silenced = 1
fire_sound = 'sound/weapons/Genhit.ogg'
projectile_type = /obj/item/projectile/energy/bolt
@@ -54,6 +54,7 @@
w_class = ITEMSIZE_LARGE
force = 10
matter = list(DEFAULT_WALL_MATERIAL = 200000)
slot_flags = SLOT_BELT
projectile_type = /obj/item/projectile/energy/bolt/large
/obj/item/weapon/gun/energy/plasmastun
@@ -0,0 +1,195 @@
/obj/item/weapon/gun/magnetic
name = "improvised coilgun"
desc = "A coilgun hastily thrown together out of a basic frame and advanced power storage components. Is it safe for it to be duct-taped together like that?"
icon_state = "coilgun"
item_state = "coilgun"
icon = 'icons/obj/railgun.dmi'
// one_hand_penalty = 1
origin_tech = list(TECH_COMBAT = 5, TECH_MATERIAL = 4, TECH_ILLEGAL = 2, TECH_MAGNET = 4)
w_class = ITEMSIZE_LARGE
var/obj/item/weapon/cell/cell // Currently installed powercell.
var/obj/item/weapon/stock_parts/capacitor/capacitor // Installed capacitor. Higher rating == faster charge between shots.
var/removable_components = TRUE // Whether or not the gun can be dismantled.
var/gun_unreliable = 15 // Percentage chance of detonating in your hands.
var/obj/item/loaded // Currently loaded object, for retrieval/unloading.
var/load_type = /obj/item/stack/rods // Type of stack to load with.
var/projectile_type = /obj/item/projectile/bullet/magnetic // Actual fire type, since this isn't throw_at rod launcher.
var/power_cost = 950 // Cost per fire, should consume almost an entire basic cell.
var/power_per_tick // Capacitor charge per process(). Updated based on capacitor rating.
fire_sound = 'sound/weapons/railgun.ogg'
/obj/item/weapon/gun/magnetic/New()
processing_objects.Add(src)
if(capacitor)
power_per_tick = (power_cost*0.15) * capacitor.rating
update_icon()
. = ..()
/obj/item/weapon/gun/magnetic/Destroy()
processing_objects.Remove(src)
qdel_null(cell)
qdel_null(loaded)
qdel_null(capacitor)
. = ..()
/obj/item/weapon/gun/magnetic/process()
if(capacitor)
if(cell)
if(capacitor.charge < capacitor.max_charge && cell.checked_use(power_per_tick))
capacitor.charge(power_per_tick)
else
capacitor.use(capacitor.charge * 0.05)
update_icon()
/obj/item/weapon/gun/magnetic/update_icon()
var/list/overlays_to_add = list()
if(removable_components)
if(cell)
overlays_to_add += image(icon, "[icon_state]_cell")
if(capacitor)
overlays_to_add += image(icon, "[icon_state]_capacitor")
if(!cell || !capacitor)
overlays_to_add += image(icon, "[icon_state]_red")
else if(capacitor.charge < power_cost)
overlays_to_add += image(icon, "[icon_state]_amber")
else
overlays_to_add += image(icon, "[icon_state]_green")
if(loaded)
overlays_to_add += image(icon, "[icon_state]_loaded")
overlays = overlays_to_add
..()
/obj/item/weapon/gun/magnetic/proc/show_ammo(var/mob/user)
if(loaded)
to_chat(user, "<span class='notice'>It has \a [loaded] loaded.</span>")
/obj/item/weapon/gun/magnetic/examine(var/mob/user)
. = ..(user, 2)
if(.)
show_ammo(user)
if(cell)
to_chat(user, "<span class='notice'>The installed [cell.name] has a charge level of [round((cell.charge/cell.maxcharge)*100)]%.</span>")
if(capacitor)
to_chat(user, "<span class='notice'>The installed [capacitor.name] has a charge level of [round((capacitor.charge/capacitor.max_charge)*100)]%.</span>")
if(!cell || !capacitor)
to_chat(user, "<span class='notice'>The capacitor charge indicator is blinking <font color ='[COLOR_RED]'>red</font>. Maybe you should check the cell or capacitor.</span>")
else
if(capacitor.charge < power_cost)
to_chat(user, "<span class='notice'>The capacitor charge indicator is <font color ='[COLOR_ORANGE]'>amber</font>.</span>")
else
to_chat(user, "<span class='notice'>The capacitor charge indicator is <font color ='[COLOR_GREEN]'>green</font>.</span>")
return TRUE
/obj/item/weapon/gun/magnetic/attackby(var/obj/item/thing, var/mob/user)
if(removable_components)
if(istype(thing, /obj/item/weapon/cell))
if(cell)
to_chat(user, "<span class='warning'>\The [src] already has \a [cell] installed.</span>")
return
cell = thing
user.drop_from_inventory(cell)
cell.forceMove(src)
playsound(loc, 'sound/machines/click.ogg', 10, 1)
user.visible_message("<span class='notice'>\The [user] slots \the [cell] into \the [src].</span>")
update_icon()
return
if(isscrewdriver(thing))
if(!capacitor)
to_chat(user, "<span class='warning'>\The [src] has no capacitor installed.</span>")
return
capacitor.forceMove(get_turf(src))
user.put_in_hands(capacitor)
user.visible_message("<span class='notice'>\The [user] unscrews \the [capacitor] from \the [src].</span>")
playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1)
capacitor = null
update_icon()
return
if(istype(thing, /obj/item/weapon/stock_parts/capacitor))
if(capacitor)
to_chat(user, "<span class='warning'>\The [src] already has \a [capacitor] installed.</span>")
return
capacitor = thing
user.drop_from_inventory(capacitor)
capacitor.forceMove(src)
playsound(loc, 'sound/machines/click.ogg', 10, 1)
power_per_tick = (power_cost*0.15) * capacitor.rating
user.visible_message("<span class='notice'>\The [user] slots \the [capacitor] into \the [src].</span>")
update_icon()
return
if(istype(thing, load_type))
if(loaded)
to_chat(user, "<span class='warning'>\The [src] already has \a [loaded] loaded.</span>")
return
// This is not strictly necessary for the magnetic gun but something using
// specific ammo types may exist down the track.
var/obj/item/stack/ammo = thing
if(!istype(ammo))
loaded = thing
user.drop_from_inventory(thing)
thing.forceMove(src)
else
loaded = new load_type(src, 1)
ammo.use(1)
user.visible_message("<span class='notice'>\The [user] loads \the [src] with \the [loaded].</span>")
playsound(loc, 'sound/weapons/flipblade.ogg', 50, 1)
update_icon()
return
. = ..()
/obj/item/weapon/gun/magnetic/attack_hand(var/mob/user)
if(user.get_inactive_hand() == src)
var/obj/item/removing
if(loaded)
removing = loaded
loaded = null
else if(cell && removable_components)
removing = cell
cell = null
if(removing)
removing.forceMove(get_turf(src))
user.put_in_hands(removing)
user.visible_message("<span class='notice'>\The [user] removes \the [removing] from \the [src].</span>")
playsound(loc, 'sound/machines/click.ogg', 10, 1)
update_icon()
return
. = ..()
/obj/item/weapon/gun/magnetic/proc/check_ammo()
return loaded
/obj/item/weapon/gun/magnetic/proc/use_ammo()
qdel(loaded)
loaded = null
/obj/item/weapon/gun/magnetic/consume_next_projectile()
if(!check_ammo() || !capacitor || capacitor.charge < power_cost)
return
use_ammo()
capacitor.use(power_cost)
update_icon()
if(gun_unreliable && prob(gun_unreliable))
spawn(3) // So that it will still fire - considered modifying Fire() to return a value but burst fire makes that annoying.
visible_message("<span class='danger'>\The [src] explodes with the force of the shot!</span>")
explosion(get_turf(src), -1, 0, 2)
qdel(src)
return new projectile_type(src)
@@ -0,0 +1,101 @@
// We really need some datums for this.
/obj/item/weapon/coilgun_assembly
name = "coilgun stock"
desc = "It might be a coilgun, someday."
icon = 'icons/obj/coilgun.dmi'
icon_state = "coilgun_construction_1"
var/construction_stage = 1
/obj/item/weapon/coilgun_assembly/attackby(var/obj/item/thing, var/mob/user)
if(istype(thing, /obj/item/stack/material) && construction_stage == 1)
var/obj/item/stack/material/reinforcing = thing
var/material/reinforcing_with = reinforcing.get_material()
if(reinforcing_with.name == DEFAULT_WALL_MATERIAL) // Steel
if(reinforcing.get_amount() < 5)
to_chat(user, "<span class='warning'>You need at least 5 [reinforcing.singular_name]\s for this task.</span>")
return
reinforcing.use(5)
user.visible_message("<span class='notice'>\The [user] shapes some steel sheets around \the [src] to form a body.</span>")
increment_construction_stage()
return
if(istype(thing, /obj/item/weapon/tape_roll) && construction_stage == 2)
user.visible_message("<span class='notice'>\The [user] secures \the [src] together with \the [thing].</span>")
increment_construction_stage()
return
if(istype(thing, /obj/item/pipe) && construction_stage == 3)
user.drop_from_inventory(thing)
qdel(thing)
user.visible_message("<span class='notice'>\The [user] jams \the [thing] into \the [src].</span>")
increment_construction_stage()
return
if(istype(thing, /obj/item/weapon/weldingtool) && construction_stage == 4)
var/obj/item/weapon/weldingtool/welder = thing
if(!welder.isOn())
to_chat(user, "<span class='warning'>Turn it on first!</span>")
return
if(!welder.remove_fuel(0,user))
to_chat(user, "<span class='warning'>You need more fuel!</span>")
return
user.visible_message("<span class='notice'>\The [user] welds the barrel of \the [src] into place.</span>")
playsound(src.loc, 'sound/items/Welder2.ogg', 100, 1)
increment_construction_stage()
return
if(istype(thing, /obj/item/stack/cable_coil) && construction_stage == 5)
var/obj/item/stack/cable_coil/cable = thing
if(cable.get_amount() < 5)
to_chat(user, "<span class='warning'>You need at least 5 lengths of cable for this task.</span>")
return
cable.use(5)
user.visible_message("<span class='notice'>\The [user] wires \the [src].</span>")
increment_construction_stage()
return
if(istype(thing, /obj/item/weapon/smes_coil) && construction_stage >= 6 && construction_stage <= 8)
user.visible_message("<span class='notice'>\The [user] installs \a [thing] into \the [src].</span>")
user.drop_from_inventory(thing)
qdel(thing)
increment_construction_stage()
return
if(isscrewdriver(thing) && construction_stage >= 9)
user.visible_message("<span class='notice'>\The [user] secures \the [src] and finishes it off.</span>")
playsound(loc, 'sound/items/Screwdriver.ogg', 50, 1)
var/obj/item/weapon/gun/magnetic/coilgun = new(loc)
var/put_in_hands
var/mob/M = src.loc
if(istype(M))
put_in_hands = M == user
M.drop_from_inventory(src)
if(put_in_hands)
user.put_in_hands(coilgun)
qdel(src)
return
return ..()
/obj/item/weapon/coilgun_assembly/proc/increment_construction_stage()
if(construction_stage < 9)
construction_stage++
icon_state = "coilgun_construction_[construction_stage]"
/obj/item/weapon/coilgun_assembly/examine(var/mob/user)
. = ..(user,2)
if(.)
switch(construction_stage)
if(2) to_chat(user, "<span class='notice'>It has a metal frame loosely shaped around the stock.</span>")
if(3) to_chat(user, "<span class='notice'>It has a metal frame duct-taped to the stock.</span>")
if(4) to_chat(user, "<span class='notice'>It has a length of pipe attached to the body.</span>")
if(4) to_chat(user, "<span class='notice'>It has a length of pipe welded to the body.</span>")
if(6) to_chat(user, "<span class='notice'>It has a cable mount and capacitor jack wired to the frame.</span>")
if(7) to_chat(user, "<span class='notice'>It has a single superconducting coil threaded onto the barrel.</span>")
if(8) to_chat(user, "<span class='notice'>It has a pair of superconducting coils threaded onto the barrel.</span>")
if(9) to_chat(user, "<span class='notice'>It has three superconducting coils attached to the body, waiting to be secured.</span>")
@@ -0,0 +1,104 @@
/obj/item/weapon/gun/magnetic/railgun
name = "railgun"
desc = "The Mars Military Industries MI-76 Thunderclap. A man-portable mass driver for squad support anti-armour and destruction of fortifications and emplacements."
gun_unreliable = 0
icon_state = "railgun"
removable_components = FALSE
load_type = /obj/item/weapon/rcd_ammo
origin_tech = list(TECH_COMBAT = 5, TECH_MATERIAL = 4, TECH_MAGNET = 4)
projectile_type = /obj/item/projectile/bullet/magnetic/slug
power_cost = 300
w_class = ITEMSIZE_HUGE
slot_flags = SLOT_BELT
loaded = /obj/item/weapon/rcd_ammo/large
var/initial_cell_type = /obj/item/weapon/cell/hyper
var/initial_capacitor_type = /obj/item/weapon/stock_parts/capacitor/adv
var/slowdown_held = 2
var/slowdown_worn = 1
/obj/item/weapon/gun/magnetic/railgun/New()
capacitor = new initial_capacitor_type(src)
capacitor.charge = capacitor.max_charge
cell = new initial_cell_type(src)
if (ispath(loaded))
loaded = new loaded
. = ..()
// Not going to check type repeatedly, if you code or varedit
// load_type and get runtime errors, don't come crying to me.
/obj/item/weapon/gun/magnetic/railgun/show_ammo(var/mob/user)
var/obj/item/weapon/rcd_ammo/ammo = loaded
if (ammo)
to_chat(user, "<span class='notice'>There are [ammo.remaining] shot\s remaining in \the [loaded].</span>")
else
to_chat(user, "<span class='notice'>There is nothing loaded.</span>")
/obj/item/weapon/gun/magnetic/railgun/check_ammo()
var/obj/item/weapon/rcd_ammo/ammo = loaded
return ammo && ammo.remaining
/obj/item/weapon/gun/magnetic/railgun/use_ammo()
var/obj/item/weapon/rcd_ammo/ammo = loaded
ammo.remaining--
if(ammo.remaining <= 0)
spawn(3)
playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 1)
out_of_ammo()
/obj/item/weapon/gun/magnetic/railgun/proc/out_of_ammo()
qdel(loaded)
loaded = null
visible_message("<span class='warning'>\The [src] beeps and ejects its empty cartridge.</span>")
/obj/item/weapon/gun/magnetic/railgun/automatic // Adminspawn only, this shit is absurd.
name = "\improper RHR accelerator"
desc = "The Mars Military Industries MI-227 Meteor. Originally a vehicle-mounted turret weapon for heavy anti-vehicular and anti-structural fire, the fact that it was made man-portable is mindboggling in itself."
icon_state = "heavy_railgun"
initial_cell_type = /obj/item/weapon/cell/infinite
initial_capacitor_type = /obj/item/weapon/stock_parts/capacitor/super
slowdown_held = 3
slowdown_worn = 2
slot_flags = SLOT_BACK
w_class = ITEMSIZE_NO_CONTAINER
firemodes = list(
list(mode_name="semiauto", burst=1, fire_delay=0, move_delay=null, one_hand_penalty=1, burst_accuracy=null, dispersion=null),
list(mode_name="short bursts", burst=3, fire_delay=null, move_delay=5, one_hand_penalty=2, burst_accuracy=list(0,-1,-1), dispersion=list(0.0, 0.6, 1.0)),
list(mode_name="long bursts", burst=6, fire_delay=null, move_delay=10, one_hand_penalty=2, burst_accuracy=list(0,-1,-1,-1,-2), dispersion=list(0.6, 0.6, 1.0, 1.0, 1.2)),
)
/obj/item/weapon/gun/magnetic/railgun/automatic/examine(var/mob/user)
. = ..(user,1)
if(.)
to_chat(user, "<span class='notice'>Someone has scratched <i>Ultima Ratio Regum</i> onto the side of the barrel.</span>")
/obj/item/weapon/gun/magnetic/railgun/flechette
name = "flechette gun"
desc = "The MI-12 Skadi is a burst fire capable railgun that fires flechette rounds at high velocity. Deadly against armour, but much less effective against soft targets."
icon_state = "flechette_gun"
item_state = "z8carbine"
initial_cell_type = /obj/item/weapon/cell/hyper
initial_capacitor_type = /obj/item/weapon/stock_parts/capacitor/adv
slot_flags = SLOT_BACK
slowdown_held = 0
slowdown_worn = 0
power_cost = 100
load_type = /obj/item/weapon/magnetic_ammo
projectile_type = /obj/item/projectile/bullet/magnetic/flechette
loaded = /obj/item/weapon/magnetic_ammo
fire_sound = 'sound/weapons/rapidslice.ogg'
firemodes = list(
list(mode_name="semiauto", burst=1, fire_delay=0, move_delay=null, one_hand_penalty=1, burst_accuracy=null, dispersion=null),
list(mode_name="short bursts", burst=3, fire_delay=null, move_delay=5, one_hand_penalty=2, burst_accuracy=list(0,-1,-1), dispersion=list(0.0, 0.6, 1.0)),
)
/obj/item/weapon/gun/magnetic/railgun/flechette/out_of_ammo()
audible_message("<span class='warning'>\The [src] beeps to indicate the magazine is empty.</span>")
playsound(loc, 'sound/weapons/smg_empty_alarm.ogg', 40, 1)
..()
+21 -4
View File
@@ -45,6 +45,8 @@
var/penetrating = 0 //If greater than zero, the projectile will pass through dense objects as specified by on_penetrate()
var/kill_count = 50 //This will de-increment every process(). When 0, it will delete the projectile.
//Effects
var/incendiary = 0 //1 for ignite on hit, 2 for trail of fire. 3 maybe later for burst of fire around the impact point. - Mech
var/flammability = 0 //Amount of fire stacks to add for the above.
var/stun = 0
var/weaken = 0
var/paralyze = 0
@@ -78,7 +80,7 @@
if(!isliving(target)) return 0
// if(isanimal(target)) return 0
var/mob/living/L = target
L.apply_effects(stun, weaken, paralyze, irradiate, stutter, eyeblur, drowsy, agony, blocked) // add in AGONY!
L.apply_effects(stun, weaken, paralyze, irradiate, stutter, eyeblur, drowsy, agony, blocked, incendiary, flammability) // add in AGONY!
return 1
//called when the projectile stops flying because it collided with something
@@ -233,9 +235,18 @@
//if they have a neck grab on someone, that person gets hit instead
var/obj/item/weapon/grab/G = locate() in M
if(G && G.state >= GRAB_NECK)
visible_message("<span class='danger'>\The [M] uses [G.affecting] as a shield!</span>")
if(Bump(G.affecting, forced=1))
return //If Bump() returns 0 (keep going) then we continue on to attack M.
if(G.affecting.stat == DEAD)
var/shield_chance = min(80, (30 * (M.mob_size / 10))) //Small mobs have a harder time keeping a dead body as a shield than a human-sized one. Unathi would have an easier job, if they are made to be SIZE_LARGE in the future. -Mech
if(prob(shield_chance))
visible_message("<span class='danger'>\The [M] uses [G.affecting] as a shield!</span>")
if(Bump(G.affecting, forced=1))
return
else
visible_message("<span class='danger'>\The [M] tries to use [G.affecting] as a shield, but fails!</span>")
else
visible_message("<span class='danger'>\The [M] uses [G.affecting] as a shield!</span>")
if(Bump(G.affecting, forced=1))
return //If Bump() returns 0 (keep going) then we continue on to attack M.
passthrough = !attack_mob(M, distance)
else
@@ -322,6 +333,10 @@
else if(!bumped)
tracer_effect(effect_transform)
if(incendiary >= 2)
var/trail_volume = (flammability * 0.10)
new /obj/effect/decal/cleanable/liquid_fuel/flamethrower_fuel(src.loc, trail_volume, src.dir)
if(!hitscan)
sleep(step_delay) //add delay between movement iterations if it's not a hitscan weapon
@@ -404,6 +419,8 @@
return //cannot shoot yourself
if(istype(A, /obj/item/projectile))
return
if(istype(A, /obj/structure/foamedmetal)) //Turrets can detect through foamed metal, but will have to blast through it. Similar to windows, if someone runs behind it, a person should probably just not shoot.
return
if(istype(A, /mob/living) || istype(A, /obj/mecha) || istype(A, /obj/vehicle))
result = 2 //We hit someone, return 1!
return
@@ -252,6 +252,31 @@
explosion(target, -1, 0, 2)
..()
/* Incendiary */
/obj/item/projectile/bullet/incendiary
name = "incendiary bullet"
icon_state = "bullet_alt"
damage = 15
damage_type = BURN
incendiary = 1
flammability = 2
/obj/item/projectile/bullet/incendiary/flamethrower
name = "ball of fire"
desc = "Don't stand in the fire."
icon_state = "fireball"
damage = 10
embed_chance = 0
incendiary = 2
flammability = 4
agony = 30
kill_count = 4
/obj/item/projectile/bullet/incendiary/flamethrower/large
damage = 15
kill_count = 6
/obj/item/projectile/bullet/blank
invisibility = 101
damage = 1
@@ -0,0 +1,21 @@
// Rod for railguns. Slightly less nasty than the sniper round.
/obj/item/projectile/bullet/magnetic
name = "rod"
icon_state = "rod"
damage = 65
stun = 1
weaken = 1
penetrating = 5
armor_penetration = 70
/obj/item/projectile/bullet/magnetic/slug
name = "slug"
icon_state = "gauss_silenced"
damage = 75
armor_penetration = 90
/obj/item/projectile/bullet/magnetic/flechette
name = "flechette"
icon_state = "flechette"
damage = 20
armor_penetration = 100