Merge branch 'master' of https://github.com/PolarisSS13/Polaris into is_tool

This commit is contained in:
Anewbe
2018-08-02 22:35:14 -05:00
262 changed files with 7022 additions and 3130 deletions

View File

@@ -325,6 +325,31 @@
/obj/item/ammo_magazine/box/c9mm/empty
initial_ammo = 0
/obj/item/ammo_magazine/m9mmR/saber
desc = "A very high capacity double stack magazine made specially for the SABER SMG. Filled with 22 9mm bullets."
icon_state = "S9mm-22"
mag_type = MAGAZINE
ammo_type = /obj/item/ammo_casing/a9mm
matter = list(DEFAULT_WALL_MATERIAL = 1200)
caliber = "9mm"
max_ammo = 22
origin_tech = list(TECH_COMBAT = 2, TECH_ILLEGAL = 1)
multiple_sprites = 1
/obj/item/ammo_magazine/m9mmR/saber/ap
desc = "A high capacity double stack magazine made specially for the SABER SMG. Filled with 22 9mm armor piercing bullets."
icon_state = "S9mm-22"
mag_type = MAGAZINE
ammo_type = /obj/item/ammo_casing/a9mm/ap
matter = list(DEFAULT_WALL_MATERIAL = 2000)
caliber = "9mm"
max_ammo = 22
origin_tech = list(TECH_COMBAT = 2, TECH_ILLEGAL = 1)
multiple_sprites = 1
/obj/item/ammo_magazine/m9mmR/saber/empty
initial_ammo = 0
///////// 10mm /////////
/obj/item/ammo_magazine/m10mm

View File

@@ -23,17 +23,6 @@
var/battery_lock = 0 //If set, weapon cannot switch batteries
/obj/item/weapon/gun/energy/attackby(var/obj/item/A as obj, mob/user as mob)
..()
/obj/item/weapon/gun/energy/switch_firemodes(mob/user)
if(..())
update_icon()
/obj/item/weapon/gun/energy/emp_act(severity)
..()
update_icon()
/obj/item/weapon/gun/energy/New()
..()
if(self_recharge)
@@ -52,6 +41,9 @@
processing_objects.Remove(src)
return ..()
/obj/item/weapon/gun/energy/get_cell()
return power_supply
/obj/item/weapon/gun/energy/process()
if(self_recharge) //Every [recharge_time] ticks, recharge a shot for the battery
if(world.time > last_shot + charge_delay) //Doesn't work if you've fired recently
@@ -75,6 +67,17 @@
charge_tick = 0
return 1
/obj/item/weapon/gun/energy/attackby(var/obj/item/A as obj, mob/user as mob)
..()
/obj/item/weapon/gun/energy/switch_firemodes(mob/user)
if(..())
update_icon()
/obj/item/weapon/gun/energy/emp_act(severity)
..()
update_icon()
/obj/item/weapon/gun/energy/consume_next_projectile()
if(!power_supply) return null
if(!ispath(projectile_type)) return null

View File

@@ -0,0 +1,57 @@
// Phase weapons go here
/obj/item/weapon/gun/energy/phasegun
name = "phase carbine"
desc = "The NT EW26 Artemis is a downsized energy weapon, specifically designed for use against wildlife."
icon_state = "phasecarbine"
item_state = "phasecarbine"
wielded_item_state = "phasecarbine-wielded"
slot_flags = SLOT_BACK|SLOT_BELT
charge_cost = 240
projectile_type = /obj/item/projectile/energy/phase
one_handed_penalty = 15
/obj/item/weapon/gun/energy/phasegun/pistol
name = "phase pistol"
desc = "The NT EW15 Apollo is an energy handgun, specifically designed for self-defense against aggressive wildlife."
icon_state = "phase"
item_state = "taser" //I don't have an in-hand sprite, taser will be fine
w_class = ITEMSIZE_NORMAL
slot_flags = SLOT_BELT|SLOT_HOLSTER
charge_cost = 300
projectile_type = /obj/item/projectile/energy/phase/light
one_handed_penalty = 0
/obj/item/weapon/gun/energy/phasegun/pistol/mounted
name = "mounted phase pistol"
self_recharge = 1
use_external_power = 1
/obj/item/weapon/gun/energy/phasegun/pistol/mounted/cyborg
charge_cost = 400
recharge_time = 7
obj/item/weapon/gun/energy/phasegun/rifle
name = "phase rifle"
desc = "The NT EW31 Orion is a specialist energy weapon, intended for use against hostile wildlife."
icon_state = "phaserifle"
item_state = "phaserifle"
wielded_item_state = "phaserifle-wielded"
slot_flags = SLOT_BACK
charge_cost = 150
projectile_type = /obj/item/projectile/energy/phase/heavy
accuracy = 15
one_handed_penalty = 30
/obj/item/weapon/gun/energy/phasegun/cannon
name = "phase cannon"
desc = "The NT EW50 Gaia is a massive energy weapon, purpose-built for clearing land. You feel dirty just looking at it."
icon_state = "phasecannon"
item_state = "phasecannon"
wielded_item_state = "phasecannon-wielded" //TODO: New Sprites
w_class = ITEMSIZE_HUGE // This thing is big.
slot_flags = SLOT_BACK
charge_cost = 100
projectile_type = /obj/item/projectile/energy/phase/heavy/cannon
accuracy = 15
one_handed_penalty = 65

View File

@@ -25,15 +25,6 @@
charge_cost = 480
projectile_type = /obj/item/projectile/ion/pistol
/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."

View File

@@ -36,6 +36,9 @@
qdel_null(capacitor)
. = ..()
/obj/item/weapon/gun/magnetic/get_cell()
return cell
/obj/item/weapon/gun/magnetic/process()
if(capacitor)
if(cell)

View File

@@ -1,25 +1,40 @@
/obj/item/weapon/gun/projectile/automatic //Hopefully someone will find a way to make these fire in bursts or something. --Superxpdude //Except burstfire isn't fit for an rp server --Mark
/obj/item/weapon/gun/projectile/automatic //This should never be spawned in, it is just here because of code necessities.
name = "daka SMG"
desc = "A small SMG. You really shouldn't be able to get this gun. Uses 9mm rounds."
icon_state = "c05r" //Used because it's not used anywhere else
load_method = SPEEDLOADER
ammo_type = /obj/item/ammo_casing/a9mm
projectile_type = /obj/item/projectile/bullet/pistol
//Burst is the number of bullets fired; Fire delay is the time you have to wait to shoot the gun again, Move delay is the same but for moving after shooting. .
//Burst accuracy is the accuracy of each bullet fired in the burst. Dispersion is how much the bullets will 'spread' away from where you aimed.
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,-15,-15), dispersion=list(0.0, 0.6, 1.0)))
/obj/item/weapon/gun/projectile/automatic/saber //Fixed it
name = "prototype SMG"
desc = "A protoype lightweight, fast firing gun. Uses 9mm rounds."
icon_state = "saber" //ugly
icon = 'icons/obj/gun.dmi'
icon_state = "saber"//Still ugly
w_class = ITEMSIZE_NORMAL
load_method = SPEEDLOADER //yup. until someone sprites a magazine for it.
load_method = MAGAZINE //This should fix it
max_shells = 22
caliber = "9mm"
origin_tech = list(TECH_COMBAT = 4, TECH_MATERIAL = 2)
slot_flags = SLOT_BELT
ammo_type = /obj/item/ammo_casing/a9mm
magazine_type = /obj/item/ammo_magazine/m9mmR/saber
allowed_magazines = list(/obj/item/ammo_magazine/m9mmR/saber, /obj/item/ammo_magazine/m9mmR/saber/ap)
projectile_type = /obj/item/projectile/bullet/pistol
multi_aim = 1
burst_delay = 2
// one_handed_penalty = 15
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,-15,-15), dispersion=list(0.0, 0.6, 1.0))
// list(mode_name="short bursts", burst=5, fire_delay=null, move_delay=4, burst_accuracy=list(0,-15,-15,-30,-30), dispersion=list(0.6, 1.0, 1.0, 1.0, 1.2)),
)
// list(mode_name="short bursts", burst=5, fire_delay=null, move_delay=4, burst_accuracy=list(0,-15,-15,-30,-30), dispersion=list(0.6, 1.0, 1.0, 1.0, 1.2)),
)
/obj/item/weapon/gun/projectile/automatic/c20r
name = "submachine gun"

View File

@@ -0,0 +1,134 @@
// These projectiles are somewhat different from the other projectiles in the code.
// First, these have an 'arcing' visual, that is accomplished by having the projectile icon rotate as its flying, and
// moving up, then down as it approaches the target. There is also a small shadow effect that follows the projectile
// as its flying.
// Besides the visuals, arcing projectiles do not collide with anything until they reach the target, as they fly over them.
// For best effect, use this only when it makes sense to do so, IE on the Surface. The projectiles don't care about ceilings or gravity.
/obj/item/projectile/arc
name = "arcing shot"
icon_state = "fireball" // WIP
step_delay = 2 // Travel a bit slower, to really sell the arc visuals.
plane = ABOVE_PLANE // Since projectiles are 'in the air', they might visually overlap mobs while in flight, so the projectile needs to be above their plane.
var/target_distance = null // How many tiles the impact site is.
var/fired_dir = null // Which direction was the projectile fired towards. Needed to invert the projectile turning based on if facing left or right.
var/obj/effect/projectile_shadow/shadow = null // Visual indicator for the projectile's 'true' position. Needed due to being bound to two dimensions in reality.
/obj/item/projectile/arc/initialize()
shadow = new(get_turf(src))
return ..()
/obj/item/projectile/arc/Destroy()
qdel_null(shadow)
return ..()
/obj/item/projectile/arc/Bump(atom/A, forced=0)
return 0
// if(get_turf(src) != original)
// return 0
// else
// return ..()
// This is a test projectile in the sense that its testing the code to make sure it works,
// as opposed to a 'can I hit this thing' projectile.
/obj/item/projectile/arc/test/on_impact(turf/T)
new /obj/effect/explosion(T)
return ..()
/obj/item/projectile/arc/launch(atom/target, target_zone, x_offset=0, y_offset=0, angle_offset=0)
var/expected_distance = get_dist(target, loc)
kill_count = expected_distance // So the projectile "hits the ground."
target_distance = expected_distance
fired_dir = get_dir(loc, target)
..() // Does the regular launching stuff.
if(fired_dir & EAST)
transform = turn(transform, -45)
else if(fired_dir & WEST)
transform = turn(transform, 45)
// Visuals.
/obj/item/projectile/arc/after_move()
// Handle projectile turning in flight.
// This won't turn if fired north/south, as it looks weird.
var/turn_per_step = 90 / target_distance
if(fired_dir & EAST)
transform = turn(transform, turn_per_step)
else if(fired_dir & WEST)
transform = turn(transform, -turn_per_step)
// Now for the fake height.
// We need to know how far along our "arc" we are.
var/arc_progress = get_dist(src, original)
var/arc_max_height = (target_distance * world.icon_size) / 2 // TODO: Real math.
// var/arc_center = target_distance / 2
// var/projectile_position = abs(arc_progress - arc_center)
// var/height_multiplier = projectile_position / arc_center
// height_multiplier = abs(height_multiplier - 1)
// height_multiplier = height_multiplier ** 2
// animate(src, pixel_z = arc_max_height * height_multiplier, time = step_delay)
var/projectile_position = arc_progress / target_distance
var/sine_position = projectile_position * 180
var/pixel_z_position = arc_max_height * sin(sine_position)
animate(src, pixel_z = pixel_z_position, time = step_delay)
// Update our shadow.
shadow.forceMove(loc)
/obj/effect/projectile_shadow
name = "shadow"
desc = "You better avoid the thing coming down!"
icon = 'icons/obj/projectiles.dmi'
icon_state = "arc_shadow"
anchored = TRUE
//////////////
// Subtypes
//////////////
// Generic, Hivebot related
/obj/item/projectile/arc/blue_energy
name = "energy missile"
icon_state = "force_missile"
damage = 15
damage_type = BURN
// Fragmentation arc shot
/obj/item/projectile/arc/fragmentation
name = "fragmentation shot"
icon_state = "shell"
var/list/fragment_types = list(
/obj/item/projectile/bullet/pellet/fragment, /obj/item/projectile/bullet/pellet/fragment, \
/obj/item/projectile/bullet/pellet/fragment, /obj/item/projectile/bullet/pellet/fragment/strong
)
var/fragment_amount = 63 // Same as a grenade.
var/spread_range = 7
/obj/item/projectile/arc/fragmentation/on_impact(turf/T)
fragmentate(T, fragment_amount, spread_range, fragment_types)
// EMP arc shot
/obj/item/projectile/arc/emp_blast
name = "emp blast"
icon_state = "bluespace"
/obj/item/projectile/arc/emp_blast/on_impact(turf/T)
empulse(T, 2, 4, 7, 10) // Normal EMP grenade.
return ..()
/obj/item/projectile/arc/emp_blast/weak/on_impact(turf/T)
empulse(T, 1, 2, 3, 4) // Sec EMP grenade.
return ..()
// Radiation arc shot
/obj/item/projectile/arc/radioactive
name = "radiation blast"
icon_state = "green_pellet"
icon_scale = 2
var/rad_power = 50
/obj/item/projectile/arc/radioactive/on_impact(turf/T)
radiation_repository.radiate(T, rad_power)

View File

@@ -10,7 +10,7 @@
var/frequency = 1
hitscan = 1
embed_chance = 0
invisibility = 101 //beam projectiles are invisible as they are rendered by the effect engine
invisibility = 99 //beam projectiles are invisible as they are rendered by the effect engine
light_range = 2
light_power = 0.5
light_color = "#FF0D00"

View File

@@ -212,7 +212,22 @@
muzzle_type = /obj/effect/projectile/pulse/muzzle
/obj/item/projectile/energy/phase
kill_count = 4
name = "phase wave"
icon_state = "phase"
kill_count = 6
damage = 5
SA_bonus_damage = 55 // 60 total on animals.
SA_vulnerability = SA_ANIMAL
SA_bonus_damage = 45 // 50 total on animals
SA_vulnerability = SA_ANIMAL
/obj/item/projectile/energy/phase/light
kill_count = 4
SA_bonus_damage = 35 // 40 total on animals
/obj/item/projectile/energy/phase/heavy
kill_count = 8
SA_bonus_damage = 55 // 60 total on animals
/obj/item/projectile/energy/phase/heavy/cannon
kill_count = 10
damage = 15
SA_bonus_damage = 60 // 75 total on animals

View File

@@ -6,7 +6,7 @@
anchored = 1
density = 0
opacity = 0
layer = FLY_LAYER
plane = ABOVE_PLANE
simulated = 0
mouse_opacity = 0