mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
lookin good
This commit is contained in:
@@ -577,7 +577,6 @@
|
||||
pixel_y = rand(-10.0, 10)
|
||||
|
||||
|
||||
#define OSIPR_MAG_FULL 30
|
||||
#define OSIPR_MAX_CORES 3
|
||||
#define OSIPR_PRIMARY_FIRE 1
|
||||
#define OSIPR_SECONDARY_FIRE 2
|
||||
@@ -594,7 +593,7 @@
|
||||
fire_delay = 0
|
||||
w_class = 3.0
|
||||
fire_sound = 'sound/weapons/osipr_fire.ogg'
|
||||
var/obj/item/osipr_magazine/magazine = null
|
||||
var/obj/item/energy_magazine/osipr/magazine = null
|
||||
var/energy_balls = 2
|
||||
var/mode = OSIPR_PRIMARY_FIRE
|
||||
|
||||
@@ -622,7 +621,7 @@
|
||||
if(!magazine || !magazine.bullets) return 0
|
||||
magazine.bullets--
|
||||
update_icon()
|
||||
in_chamber = new/obj/item/projectile/bullet/osipr()
|
||||
in_chamber = new magazine.bullet_type()
|
||||
return 1
|
||||
if(OSIPR_SECONDARY_FIRE)
|
||||
if(!energy_balls) return 0
|
||||
@@ -632,7 +631,7 @@
|
||||
return 0
|
||||
|
||||
/obj/item/weapon/gun/osipr/attackby(var/obj/item/A as obj, mob/user as mob)
|
||||
if(istype(A, /obj/item/osipr_magazine))
|
||||
if(istype(A, /obj/item/energy_magazine/osipr))
|
||||
if(magazine)
|
||||
user << "There is another magazine already inserted. Remove it first."
|
||||
else
|
||||
@@ -687,36 +686,49 @@
|
||||
item_state = "osipr-empty"
|
||||
else
|
||||
item_state = "osipr"
|
||||
var/bullets = round(magazine.bullets/(OSIPR_MAG_FULL/10))
|
||||
var/bullets = round(magazine.bullets/(magazine.max_bullets/10))
|
||||
icon_state = "osipr[bullets]0"
|
||||
|
||||
/obj/item/osipr_magazine
|
||||
name = "pulse magazine"
|
||||
desc = "Primary ammo for OSIPR. Can be replenished by a recharger."
|
||||
/obj/item/energy_magazine
|
||||
name = "energy magazine"
|
||||
desc = "Can be replenished by a recharger"
|
||||
icon = 'icons/obj/ammo.dmi'
|
||||
icon_state = "osipr-magfull"
|
||||
flags = FPRINT
|
||||
force = 1
|
||||
throwforce = 1
|
||||
w_class = 3.0
|
||||
var/bullets = OSIPR_MAG_FULL
|
||||
var/bullets = 10
|
||||
var/max_bullets = 10
|
||||
var/caliber = "osipr" //base icon name
|
||||
var/bullet_type = /obj/item/projectile/bullet/osipr
|
||||
|
||||
/obj/item/osipr_magazine/New()
|
||||
/obj/item/energy_magazine/New()
|
||||
..()
|
||||
pixel_x = rand(-10.0, 10)
|
||||
pixel_y = rand(-10.0, 10)
|
||||
update_icon()
|
||||
|
||||
/obj/item/osipr_magazine/examine(mob/user)
|
||||
/obj/item/energy_magazine/examine(mob/user)
|
||||
..()
|
||||
user << "<span class='info'>Has [bullets] pulse bullet\s remaining.</span>"
|
||||
user << "<span class='info'>Has [bullets] bullet\s remaining.</span>"
|
||||
|
||||
/obj/item/osipr_magazine/update_icon()
|
||||
if(bullets == OSIPR_MAG_FULL)
|
||||
icon_state = "osipr-magfull"
|
||||
/obj/item/energy_magazine/update_icon()
|
||||
if(bullets == max_bullets)
|
||||
icon_state = "[caliber]-magfull"
|
||||
else
|
||||
icon_state = "osipr-mag"
|
||||
icon_state = "[caliber]-mag"
|
||||
|
||||
/obj/item/energy_magazine/osipr
|
||||
name = "pulse magazine"
|
||||
desc = "Primary ammo for OSIPR. Can be replenished by a recharger."
|
||||
icon_state = "osipr-magfull"
|
||||
w_class = 3.0
|
||||
bullets = 30
|
||||
max_bullets = 30
|
||||
caliber = "osipr"
|
||||
bullet_type = /obj/item/projectile/bullet/osipr
|
||||
|
||||
#undef OSIPR_MAG_FULL
|
||||
#undef OSIPR_PRIMARY_FIRE
|
||||
#undef OSIPR_SECONDARY_FIRE
|
||||
|
||||
|
||||
@@ -268,42 +268,16 @@ var/list/impact_master = list()
|
||||
|
||||
if(bounces || phases)
|
||||
//the bullets first checks if it can bounce off the obstacle, and if it cannot it then checks if it can phase through it, if it cannot either then it dies.
|
||||
if(isturf(A) || (istype(A,/obj/machinery/door) && A.opacity))
|
||||
if(bounce_type & BOUNCEOFF_WALLS)
|
||||
rebound(A)
|
||||
bounces--
|
||||
return 1
|
||||
else if(phase_type & PHASEHTROUGH_WALLS)
|
||||
src.forceMove(get_step(src.loc,dir))
|
||||
phases--
|
||||
return 1
|
||||
else if(istype(A,/obj/structure/window) || (istype(A,/obj/machinery/door/) && !A.opacity))
|
||||
if(bounce_type & BOUNCEOFF_WINDOWS)
|
||||
rebound(A)
|
||||
bounces--
|
||||
return 1
|
||||
else if(phase_type & PHASEHTROUGH_WINDOWS)
|
||||
src.forceMove(get_step(src.loc,dir))
|
||||
phases--
|
||||
return 1
|
||||
else if(istype(A,/obj) && !istype(A,/obj/effect))
|
||||
if(bounce_type & BOUNCEOFF_OBJS)
|
||||
rebound(A)
|
||||
bounces--
|
||||
return 1
|
||||
else if(phase_type & PHASEHTROUGH_OBJS)
|
||||
src.forceMove(get_step(src.loc,dir))
|
||||
phases--
|
||||
return 1
|
||||
else if(ismob(A))
|
||||
if(bounce_type & BOUNCEOFF_MOBS)
|
||||
rebound(A)
|
||||
bounces--
|
||||
return 1
|
||||
else if(phase_type & PHASEHTROUGH_MOBS)
|
||||
src.forceMove(get_step(src.loc,dir))
|
||||
phases--
|
||||
return 1
|
||||
var/reaction_type = A.projectile_check()
|
||||
if(bounces && (bounce_type & reaction_type))
|
||||
rebound(A)
|
||||
bounces--
|
||||
return 1
|
||||
else if(phases && (phase_type & reaction_type))
|
||||
src.forceMove(get_step(src.loc,dir))
|
||||
phases--
|
||||
return 1
|
||||
|
||||
bullet_die()
|
||||
return 1
|
||||
|
||||
@@ -427,8 +401,6 @@ var/list/impact_master = list()
|
||||
|
||||
/obj/item/projectile/proc/bullet_die()
|
||||
spawn()
|
||||
density = 0
|
||||
invisibility = 101
|
||||
OnDeath()
|
||||
returnToPool(src)
|
||||
|
||||
|
||||
@@ -923,7 +923,7 @@
|
||||
stun = 2
|
||||
weaken = 2
|
||||
destroy = 1
|
||||
bounce_type = BOUNCEOFF_WALLS|BOUNCEOFF_WINDOWS
|
||||
bounce_type = PROJREACT_WALLS|PROJREACT_WINDOWS
|
||||
bounces = 1
|
||||
|
||||
/obj/item/projectile/energy/osipr
|
||||
@@ -937,12 +937,15 @@
|
||||
jittery = 30
|
||||
destroy = 0
|
||||
bounce_sound = 'sound/weapons/osipr_altbounce.ogg'
|
||||
bounce_type = BOUNCEOFF_WALLS|BOUNCEOFF_WINDOWS
|
||||
bounce_type = PROJREACT_WALLS|PROJREACT_WINDOWS
|
||||
bounces = -1
|
||||
phase_type = PHASEHTROUGH_OBJS|PHASEHTROUGH_MOBS
|
||||
phase_type = PROJREACT_OBJS|PROJREACT_MOBS
|
||||
phases = -1
|
||||
|
||||
/obj/item/projectile/energy/osipr/Destroy()
|
||||
var/turf/T = loc
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(4, 0, T)
|
||||
s.start()
|
||||
T.turf_animation('icons/obj/projectiles_impacts.dmi',"dark_explosion",0, 0, 13, 'sound/weapons/osipr_altexplosion.ogg')
|
||||
..()
|
||||
..()
|
||||
|
||||
Reference in New Issue
Block a user