TGMC Ammo HUD Port

Ports over TGMC's Ammo HUD and all relevant code, adapted to work for Polaris's guns. This took me several days, but hey, I learned a bunch. <:
Time to port Aim Mode + Mentorhelp. :3c 
- All guns now have an ammo HUD sprite. If one lacks one, it will be ??? or blank, at which point, make an issue report, as all guns should be working by now.
- Guns will display how many rounds they have left until ammunition runs dry.
- Ammo will only count the casings that CURRENTLY have a projectile in them. This is slightly unrealistic, yes, but it is better and more intuitive for the player. This also enables guns like the revolver to work, given they recycle casings.
- Up to 4 ammo HUDs can be displayed at once, but given we lack TGMC's attachments and guncode, you'll only ever usually see 2. TBD on porting over TGMC guncode. <:
- Ammunition for multiple guns has different colors in the HUD based on what you currently have loaded.
- If you're looking at this later on to add new things. DON'T USE _FLASH IN THE HUD_STATE_EMPTY. THE _FLASH IS ADDED ON BY CODE.
- Grenades have a hud_state, pending us ever porting over a grenade launcher. Rockets ALSO have a hud_state.


Example of Laser/Energy Weapons:
https://i.imgur.com/MGvqGxh.mp4
Captain's Gun:
https://i.imgur.com/Wd0SS3C.gif

Full Test of all weapons:
https://streamable.com/usp4dy

Upstream port of https://github.com/CHOMPStation2/CHOMPStation2/pull/4033
This commit is contained in:
Rykka
2022-04-07 01:00:23 -06:00
parent da2046da8d
commit 3fd5296682
19 changed files with 409 additions and 12 deletions

View File

@@ -401,6 +401,8 @@
if(muzzle_flash)
set_light(0)
user.hud_used.update_ammo_hud(user, src)
// Similar to the above proc, but does not require a user, which is ideal for things like turrets.
/obj/item/weapon/gun/proc/Fire_userless(atom/target)
@@ -493,6 +495,7 @@
/obj/item/weapon/gun/proc/handle_click_empty(mob/user)
if (user)
user.visible_message("*click click*", "<span class='danger'>*click*</span>")
user.hud_used.update_ammo_hud(user, src)
else
src.visible_message("*click click*")
playsound(src, 'sound/weapons/empty.ogg', 100, 1)
@@ -724,8 +727,35 @@
var/datum/firemode/new_mode = firemodes[sel_mode]
new_mode.apply_to(src)
to_chat(user, "<span class='notice'>\The [src] is now set to [new_mode.name].</span>")
user.hud_used.update_ammo_hud(user, src)
return new_mode
/obj/item/weapon/gun/attack_self(mob/user)
switch_firemodes(user)
/* TGMC Ammo HUD Port Begin */
/obj/item/weapon/gun
var/hud_enabled = TRUE
/obj/item/weapon/gun/proc/has_ammo_counter()
return FALSE
/obj/item/weapon/gun/proc/get_ammo_type()
return FALSE
/obj/item/weapon/gun/proc/get_ammo_count()
return FALSE
/obj/item/weapon/gun/equipped(mob/living/user, slot) // When a gun is equipped to your hands, we'll add the HUD to the user. Pending porting over TGMC guncode where wielding is far more sensible.
if(slot == slot_l_hand || slot == slot_r_hand)
user.hud_used.add_ammo_hud(user, src)
else
user.hud_used.remove_ammo_hud(user, src)
return ..()
/obj/item/weapon/gun/dropped(mob/living/user) // Ditto as above, we remove the HUD. Pending porting TGMC code to clean up this fucking nightmare of spaghetti.
user.hud_used.remove_ammo_hud(user, src)
..()

View File

@@ -90,6 +90,9 @@
power_supply.give(rechargeamt) //... to recharge 1/5th the battery
update_icon()
var/mob/living/M = loc // TGMC Ammo HUD
if(istype(M)) // TGMC Ammo HUD
M?.hud_used.update_ammo_hud(M, src) // TGMC Ammo HUD
else
charge_tick = 0
return 1
@@ -109,6 +112,9 @@
if(!power_supply) return null
if(!ispath(projectile_type)) return null
if(!power_supply.checked_use(charge_cost)) return null
var/mob/living/M = loc // TGMC Ammo HUD
if(istype(M)) // TGMC Ammo HUD
M?.hud_used.update_ammo_hud(M, src)
return new projectile_type(src)
/obj/item/weapon/gun/energy/proc/load_ammo(var/obj/item/C, mob/user)
@@ -130,6 +136,7 @@
playsound(src, 'sound/weapons/flipblade.ogg', 50, 1)
update_icon()
update_held_icon()
user.hud_used.update_ammo_hud(user, src) // TGMC Ammo HUD
else
to_chat(user, "<span class='notice'>This cell is not fitted for [src].</span>")
return
@@ -146,6 +153,7 @@
playsound(src, 'sound/weapons/empty.ogg', 50, 1)
update_icon()
update_held_icon()
user.hud_used.update_ammo_hud(user, src) // TGMC Ammo HUD
else
to_chat(user, "<span class='notice'>[src] does not have a power cell.</span>")
@@ -231,4 +239,21 @@
results += ..()
return results
return results
// TGMC AMMO HUD
/obj/item/weapon/gun/energy/has_ammo_counter()
return TRUE
/obj/item/weapon/gun/energy/get_ammo_type()
if(!projectile_type)
return list("unknown", "unknown")
else
var/obj/item/projectile/P = projectile_type
return list(initial(P.hud_state), initial(P.hud_state_empty))
/obj/item/weapon/gun/energy/get_ammo_count()
if(!power_supply)
return 0
else
return FLOOR(power_supply.charge / max(charge_cost, 1), 1)

View File

@@ -54,6 +54,10 @@
chambered = ammo_magazine.stored_ammo[ammo_magazine.stored_ammo.len]
if(handle_casings != HOLD_CASINGS)
ammo_magazine.stored_ammo -= chambered
var/mob/living/M = loc
if(istype(M))
M?.hud_used.update_ammo_hud(M, src)
if (chambered)
return chambered.BB
@@ -98,6 +102,10 @@
if(handle_casings != HOLD_CASINGS)
chambered = null
var/mob/living/M = loc
if(istype(M))
M?.hud_used.update_ammo_hud(M, src)
//Attempts to load A into src, depending on the type of thing being loaded and the load_method
@@ -117,6 +125,7 @@
AM.loc = src
ammo_magazine = AM
user.visible_message("[user] inserts [AM] into [src].", "<span class='notice'>You insert [AM] into [src].</span>")
user.hud_used.update_ammo_hud(user, src)
playsound(src, 'sound/weapons/flipblade.ogg', 50, 1)
if(SPEEDLOADER)
if(loaded.len >= max_shells)
@@ -131,8 +140,10 @@
loaded += C
AM.stored_ammo -= C //should probably go inside an ammo_magazine proc, but I guess less proc calls this way...
count++
user.hud_used.update_ammo_hud(user, src)
if(count)
user.visible_message("[user] reloads [src].", "<span class='notice'>You load [count] round\s into [src].</span>")
user.hud_used.update_ammo_hud(user, src)
playsound(src, 'sound/weapons/empty.ogg', 50, 1)
AM.update_icon()
else if(istype(A, /obj/item/ammo_casing))
@@ -168,6 +179,7 @@
sleep(1 SECOND)
update_icon()
user.hud_used.update_ammo_hud(user, src)
//attempts to unload src. If allow_dump is set to 0, the speedloader unloading method will be disabled
/obj/item/weapon/gun/projectile/proc/unload_ammo(mob/user, var/allow_dump=1)
@@ -177,6 +189,7 @@
playsound(src, 'sound/weapons/empty.ogg', 50, 1)
ammo_magazine.update_icon()
ammo_magazine = null
user.hud_used.update_ammo_hud(user, src)
else if(loaded.len)
//presumably, if it can be speed-loaded, it can be speed-unloaded.
if(allow_dump && (load_method & SPEEDLOADER))
@@ -195,9 +208,11 @@
user.put_in_hands(C)
user.visible_message("[user] removes \a [C] from [src].", "<span class='notice'>You remove \a [C] from [src].</span>")
playsound(src, 'sound/weapons/empty.ogg', 50, 1)
user.hud_used.update_ammo_hud(user, src)
else
to_chat(user, "<span class='warning'>[src] is empty.</span>")
update_icon()
user.hud_used.update_ammo_hud(user, src)
/obj/item/weapon/gun/projectile/attackby(var/obj/item/A as obj, mob/user as mob)
..()
@@ -228,6 +243,7 @@
ammo_magazine.update_icon()
ammo_magazine = null
update_icon() //make sure to do this after unsetting ammo_magazine
user.hud_used.update_ammo_hud(user, src)
/obj/item/weapon/gun/projectile/examine(mob/user)
. = ..()
@@ -256,3 +272,72 @@
unload_ammo(usr)
*/
// TGMC Ammo HUD Insertion
/obj/item/weapon/gun/projectile/has_ammo_counter()
return TRUE
/obj/item/weapon/gun/projectile/get_ammo_type()
if(load_method & MAGAZINE)
if(chambered) // Do we have an ammo casing chambered
var/obj/item/ammo_casing/A = chambered
var/obj/item/projectile/P = A.projectile_type
return list(initial(P.hud_state), initial(P.hud_state_empty))
else if(ammo_magazine && ammo_magazine.stored_ammo.len) // Do we have a mag, and have ammo in the mag, but nothing chambered?
var/obj/item/ammo_casing/A = ammo_magazine.stored_ammo[1]
var/obj/item/projectile/P = A.projectile_type
return list(initial(P.hud_state), initial(P.hud_state_empty))
else if(src.projectile_type) // Else, we're entirely empty, and irregardless of the mag we have loaded (as it's empty, or it would've passed the length check above), return the DEFAULT projectile_type on the gun, if set.
var/obj/item/projectile/P = src.projectile_type
return list(initial(P.hud_state), initial(P.hud_state_empty))
else
return list("unknown", "unknown") // Safety, this shouldn't happen, but just in case
else if(load_method & (SINGLE_CASING|SPEEDLOADER)) // Do we load with single casings OR speedloaders?
if(chambered) // Do we have an ammo casing loaded in the chamber? All casings still have a projectile_type var.
var/obj/item/ammo_casing/A = chambered
var/obj/item/projectile/P = A.projectile_type
return list(initial(P.hud_state), initial(P.hud_state_empty)) // Return the casing's projectile_type ammo hud state
else if(loaded.len) // Else, is the gun loaded, but no ammo casings in chamber currently?
var/obj/item/ammo_casing/A = loaded[1]
var/obj/item/projectile/P = A.projectile_type
return list(initial(P.hud_state), initial(P.hud_state_empty)) // Return the ammunition loaded in the gun's hud_state
else if(src.projectile_type) // Else, we're entirely empty, and have nothing loaded in the gun, and nothing in the chamber. Return the DEFAULT projectile_type on the gun, if set.
var/obj/item/projectile/P = src.projectile_type
return list(initial(P.hud_state), initial(P.hud_state_empty))
else
return list("unknown", "unknown") // Safety, this shouldn't happen, but just in case
else if(src.projectile_type) // Failsafe if we somehow don't pass the above. Return the DEFAULT projectile_type on the gun, if set.
var/obj/item/projectile/P = src.projectile_type
return list(initial(P.hud_state), initial(P.hud_state_empty))
else // Failsafe if we somehow fail all three methods
return list("unknown", "unknown")
/obj/item/weapon/gun/projectile/get_ammo_count()
if(ammo_magazine) // Do we have a magazine loaded?
var/shots_left
if(chambered && chambered.BB) // Do we have a bullet in the currently-chambered casing, if any?
shots_left++
for(var/obj/item/ammo_casing/bullet in ammo_magazine.stored_ammo)
if(bullet.BB)
shots_left++
if(shots_left > 0)
return shots_left
else
return 0 // No ammo left or failsafe.
else if(loaded) // Do we use internal ammunition
var/shots_left
if(chambered && chambered.BB) // Do we have a bullet in the currently-chambered casing, if any?
shots_left++
for(var/obj/item/ammo_casing/bullet in loaded)
if(bullet.BB) // Only increment how many shots we have left if we're loaded.
shots_left++
if(shots_left > 0)
return shots_left
else
return 0 // No ammo left or failsafe.
else if(chambered) // If we don't have a magazine or internal ammunition loaded, but we have a casing in chamber, return the amount.
return chambered.BB ? 1 : 0
else // Failsafe, or completely unloaded
return 0

View File

@@ -1,3 +1,7 @@
/*
* Shotgun
*/
/obj/item/weapon/gun/projectile/shotgun/pump
name = "shotgun"
desc = "The mass-produced MarsTech Meteor 29 shotgun is a favourite of police and security forces on many worlds. Uses 12g rounds."
@@ -39,12 +43,14 @@
else
chambered.loc = get_turf(src) // Eject casing
chambered = null
M.hud_used.update_ammo_hud(M, src) // TGMC Ammo HUD Port
// Load next shell
if(loaded.len)
var/obj/item/ammo_casing/AC = loaded[1] // load next casing.
loaded -= AC // Remove casing from loaded list.
chambered = AC
M.hud_used.update_ammo_hud(M, src) // TGMC Ammo HUD Port
if(pump_animation) // This affects all bolt action and shotguns.
flick("[pump_animation]", src) // This plays any pumping
@@ -125,6 +131,7 @@
burst = 2
user.visible_message("<span class='danger'>The shotgun goes off!</span>", "<span class='danger'>The shotgun goes off in your face!</span>")
Fire_userless(user)
user.hud_used.update_ammo_hud(user, src) // TGMC Ammo HUD Port
burst = burstsetting
return
if(do_after(user, 30)) //SHIT IS STEALTHY EYYYYY

View File

@@ -135,6 +135,10 @@
var/impact_effect_type = null
var/list/impacted_mobs = list()
// TGMC Ammo HUD Port
var/hud_state = "unknown" // What HUD state we use when we have ammunition.
var/hud_state_empty = "unknown" // The empty state. DON'T USE _FLASH IN THE NAME OF THE EMPTY STATE STRING, THAT IS ADDED BY THE CODE.
/obj/item/projectile/proc/Range()
range--

View File

@@ -23,6 +23,9 @@
tracer_type = /obj/effect/projectile/tracer/laser
impact_type = /obj/effect/projectile/impact/laser
hud_state = "laser"
hud_state_empty = "battery_empty"
/obj/item/projectile/beam/practice
name = "laser"
icon_state = "laser"
@@ -31,23 +34,28 @@
damage_type = BURN
check_armour = "laser"
eyeblur = 2
hud_state = "laser"
/obj/item/projectile/beam/weaklaser
name = "weak laser"
icon_state = "laser"
damage = 15
hud_state = "laser"
/obj/item/projectile/beam/smalllaser
damage = 25
hud_state = "laser"
/obj/item/projectile/beam/burstlaser
damage = 30
armor_penetration = 10
hud_state = "laser"
/obj/item/projectile/beam/midlaser
damage = 40
armor_penetration = 10
hud_state = "laser"
/obj/item/projectile/beam/mininglaser
name = "pulsating laser"
@@ -74,6 +82,7 @@
muzzle_type = /obj/effect/projectile/muzzle/laser_heavy
tracer_type = /obj/effect/projectile/tracer/laser_heavy
impact_type = /obj/effect/projectile/impact/laser_heavy
hud_state = "laser_overcharge"
/obj/item/projectile/beam/heavylaser/fakeemitter
name = "emitter beam"
@@ -81,6 +90,7 @@
fire_sound = 'sound/weapons/emitter.ogg'
light_color = "#00CC33"
excavation_amount = 140 // 2 shots to dig a standard rock turf. Superior due to being a mounted tool beam, to make it actually viable.
hud_state = "laser_overcharge"
muzzle_type = /obj/effect/projectile/muzzle/emitter
tracer_type = /obj/effect/projectile/tracer/emitter
@@ -90,6 +100,7 @@
damage = 80
armor_penetration = 50
light_color = "#FF0D00"
hud_state = "laser_overcharge"
/obj/item/projectile/beam/xray
name = "xray beam"
@@ -98,6 +109,7 @@
damage = 25
armor_penetration = 50
light_color = "#00CC33"
hud_state = "laser_sniper"
muzzle_type = /obj/effect/projectile/muzzle/xray
tracer_type = /obj/effect/projectile/tracer/xray
@@ -111,6 +123,7 @@
armor_penetration = 90
irradiate = 20
light_color = "#00CC33"
hud_state = "laser_sniper"
muzzle_type = /obj/effect/projectile/muzzle/xray
tracer_type = /obj/effect/projectile/tracer/xray
@@ -122,6 +135,7 @@
fire_sound = 'sound/weapons/eluger.ogg'
damage = 40
light_color = "#00C6FF"
hud_state = "laser_disabler"
muzzle_type = /obj/effect/projectile/muzzle/laser_omni
tracer_type = /obj/effect/projectile/tracer/laser_omni
@@ -134,6 +148,7 @@
damage = 100 //Badmin toy, don't care
armor_penetration = 100
light_color = "#0066FF"
hud_state = "pulse"
muzzle_type = /obj/effect/projectile/muzzle/laser_pulse
tracer_type = /obj/effect/projectile/tracer/laser_pulse
@@ -151,6 +166,7 @@
damage = 0 // The actual damage is computed in /code/modules/power/singularity/emitter.dm
light_color = "#00CC33"
excavation_amount = 70 // 3 shots to mine a turf
hud_state = "laser_overcharge"
muzzle_type = /obj/effect/projectile/muzzle/emitter
tracer_type = /obj/effect/projectile/tracer/emitter
@@ -164,13 +180,14 @@
no_attack_log = 1
damage_type = BURN
check_armour = "laser"
hud_state = "monkey"
combustion = FALSE
/obj/item/projectile/beam/lasertag/blue
icon_state = "bluelaser"
light_color = "#0066FF"
hud_state = "monkey"
muzzle_type = /obj/effect/projectile/muzzle/laser_blue
tracer_type = /obj/effect/projectile/tracer/laser_blue
impact_type = /obj/effect/projectile/impact/laser_blue
@@ -185,6 +202,7 @@
/obj/item/projectile/beam/lasertag/red
icon_state = "laser"
light_color = "#FF0D00"
hud_state = "monkey"
/obj/item/projectile/beam/lasertag/red/on_hit(var/atom/target, var/blocked = 0)
if(ishuman(target))
@@ -196,6 +214,7 @@
/obj/item/projectile/beam/lasertag/omni//A laser tag bolt that stuns EVERYONE
icon_state = "omnilaser"
light_color = "#00C6FF"
hud_state = "monkey"
muzzle_type = /obj/effect/projectile/muzzle/laser_omni
tracer_type = /obj/effect/projectile/tracer/laser_omni
@@ -215,6 +234,7 @@
damage = 50
armor_penetration = 10
light_color = "#00CC33"
hud_state = "laser_sniper"
muzzle_type = /obj/effect/projectile/muzzle/xray
tracer_type = /obj/effect/projectile/tracer/xray
@@ -231,12 +251,15 @@
light_color = "#FFFFFF"
hitsound = 'sound/weapons/zapbang.ogg'
combustion = FALSE
muzzle_type = /obj/effect/projectile/muzzle/stun
tracer_type = /obj/effect/projectile/tracer/stun
impact_type = /obj/effect/projectile/impact/stun
hud_state = "taser" // TGMC Ammo HUD port
/obj/item/projectile/beam/stun/weak
name = "weak stun beam"
icon_state = "stun"
@@ -277,6 +300,7 @@
agony = 15
eyeblur = 2
hitsound = 'sound/weapons/zapbang.ogg'
hud_state = "taser"
/obj/item/projectile/beam/shock/weak
damage = 5
@@ -294,7 +318,7 @@
damage_type = ELECTROCUTE //You should be safe inside a voidsuit
sharp = FALSE //"Wide" spectrum beam
light_color = COLOR_GOLD
hud_state = "monkey"
excavation_amount = 200 // Good at shooting rocks
muzzle_type = /obj/effect/projectile/muzzle/pointdefense

View File

@@ -12,6 +12,8 @@
impact_effect_type = /obj/effect/temp_visual/impact_effect
excavation_amount = 20
var/mob_passthrough_check = 0
hud_state = "pistol_lightap"
hud_state_empty = "pistol_empty" // Just in case we somehow have no hud_state_empty defined
muzzle_type = /obj/effect/projectile/muzzle/bullet
@@ -96,30 +98,38 @@
/obj/item/projectile/bullet/pistol // 9mm pistols and most SMGs. Sacrifice power for capacity.
fire_sound = 'sound/weapons/gunshot2.ogg'
damage = 20
hud_state = "pistol"
hud_state_empty = "pistol_empty"
/obj/item/projectile/bullet/pistol/ap
damage = 15
armor_penetration = 30
hud_state = "pistol_light_ap"
/obj/item/projectile/bullet/pistol/hp
damage = 25
armor_penetration = -50
hud_state = "pistol_ap"
/obj/item/projectile/bullet/pistol/medium // .45 (and maybe .40 if it ever gets added) caliber security pistols. Balance between capacity and power.
fire_sound = 'sound/weapons/gunshot3.ogg' // Snappier sound.
damage = 25
hud_state = "pistol"
/obj/item/projectile/bullet/pistol/medium/ap
damage = 20
armor_penetration = 15
hud_state = "pistol_light_ap"
/obj/item/projectile/bullet/pistol/medium/hp
damage = 30
armor_penetration = -50
hud_state = "pistol_ap"
/obj/item/projectile/bullet/pistol/strong // .357 and .44 caliber stuff. High power pistols like the Mateba or Desert Eagle. Sacrifice capacity for power.
fire_sound = 'sound/weapons/gunshot4.ogg'
damage = 60
hud_state = "pistol_heavy"
/obj/item/projectile/bullet/pistol/rubber/strong // "Rubber" bullets for high power pistols.
fire_sound = 'sound/weapons/gunshot3.ogg' // Rubber shots have less powder, but these still have more punch than normal rubber shot.
@@ -128,6 +138,7 @@
embed_chance = 0
sharp = 0
check_armour = "melee"
hud_state = "pistol_special"
/obj/item/projectile/bullet/pistol/rubber // "Rubber" bullets for all other pistols.
name = "rubber bullet"
@@ -136,6 +147,7 @@
embed_chance = 0
sharp = 0
check_armour = "melee"
hud_state = "pistol_special"
fire_sound ='sound/weapons/Gunshot_pathetic.ogg' // Rubber shots have less powder in the casing.
/* shotgun projectiles */
@@ -145,6 +157,8 @@
fire_sound = 'sound/weapons/Gunshot_shotgun.ogg'
damage = 50
armor_penetration = 20
hud_state = "shotgun_slug"
hud_state_empty = "shotgun_empty"
/obj/item/projectile/bullet/shotgun/beanbag //because beanbags are not bullets
name = "beanbag"
@@ -153,6 +167,7 @@
embed_chance = 0
sharp = 0
check_armour = "melee"
hud_state = "shotgun_beanbag"
//Should do about 80 damage at 1 tile distance (adjacent), and 50 damage at 3 tiles distance.
//Overall less damage than slugs in exchange for more damage at very close range and more embedding
@@ -163,12 +178,14 @@
pellets = 6
range_step = 1
spread_step = 10
hud_state = "shotgun_buckshot"
/obj/item/projectile/bullet/pellet/shotgun/flak
damage = 2 //The main weapon using these fires four at a time, usually with different destinations. Usually.
range_step = 2
spread_step = 30
armor_penetration = 10
hud_state = "shotgun_flechette"
//EMP shotgun 'slug', it's basically a beanbag that pops a tiny emp when it hits. //Not currently used
/obj/item/projectile/bullet/shotgun/ion
@@ -178,6 +195,7 @@
embed_chance = 0
sharp = 0
check_armour = "melee"
hud_state = "shotgun_ion"
combustion = FALSE
@@ -193,46 +211,57 @@
fire_sound = 'sound/weapons/Gunshot_generic_rifle.ogg'
armor_penetration = 15
penetrating = 1
hud_state = "rifle"
hud_state_empty = "rifle_empty"
/obj/item/projectile/bullet/rifle/a762
fire_sound = 'sound/weapons/Gunshot_heavy.ogg'
damage = 35
hud_state = "rifle_heavy"
/obj/item/projectile/bullet/rifle/a762/sniper // Hitscan specifically for sniper ammo; to be implimented at a later date, probably for the SVD. -Ace
fire_sound = 'sound/weapons/Gunshot_sniper.ogg'
hitscan = 1 //so the ammo isn't useless as a sniper weapon
hud_state = "hivelo"
/obj/item/projectile/bullet/rifle/a762/ap
damage = 30
armor_penetration = 50 // At 30 or more armor, this will do more damage than standard rounds.
hud_state = "rifle_ap"
/obj/item/projectile/bullet/rifle/a762/hp
damage = 40
armor_penetration = -50
penetrating = 0
hud_state = "hivelo_iff"
/obj/item/projectile/bullet/rifle/a762/hunter // Optimized for killing simple animals and not people, because Balance(tm)
damage = 20
SA_bonus_damage = 50 // 70 total on animals.
SA_vulnerability = SA_ANIMAL
hud_state = "rifle_heavy"
/obj/item/projectile/bullet/rifle/a545
fire_sound = 'sound/weapons/Gunshot_light.ogg'
damage = 25
hud_state = "rifle"
/obj/item/projectile/bullet/rifle/a545/ap
damage = 20
armor_penetration = 50 // At 40 or more armor, this will do more damage than standard rounds.
hud_state = "rifle_ap"
/obj/item/projectile/bullet/rifle/a545/hp
damage = 35
armor_penetration = -50
penetrating = 0
hud_state = "hivelo_iff"
/obj/item/projectile/bullet/rifle/a545/hunter
damage = 15
SA_bonus_damage = 35 // 50 total on animals.
SA_vulnerability = SA_ANIMAL
hud_state = "rifle_heavy"
/obj/item/projectile/bullet/rifle/a145 // 14.5<EFBFBD>114mm is bigger than a .50 BMG round.
fire_sound = 'sound/weapons/Gunshot_cannon.ogg' // This is literally an anti-tank rifle caliber. It better sound like a fucking cannon.
@@ -242,6 +271,7 @@
penetrating = 5
armor_penetration = 80
hitscan = 1 //so the PTR isn't useless as a sniper weapon
hud_state = "sniper"
icon_state = "bullet_alt"
tracer_type = /obj/effect/projectile/tracer/cannon
@@ -252,10 +282,12 @@
weaken = 0
penetrating = 15
armor_penetration = 90
hud_state = "sniper_flak"
/obj/item/projectile/bullet/rifle/a44rifle
fire_sound = 'sound/weapons/gunshot4.ogg'
damage = 50
hud_state = "revolver"
/* Mech rounds */
@@ -274,18 +306,21 @@
name = "co bullet"
damage = 20
damage_type = OXY
hud_state = "pistol_tranq"
/obj/item/projectile/bullet/cyanideround
name = "poison bullet"
damage = 40
damage_type = TOX
hud_state = "pistol_tranq"
/obj/item/projectile/bullet/burstbullet
name = "exploding bullet"
fire_sound = 'sound/effects/Explosion1.ogg'
damage = 20
embed_chance = 0
edge = 1
edge = TRUE
hud_state = "pistol_fire"
/obj/item/projectile/bullet/burstbullet/on_hit(var/atom/target, var/blocked = 0)
if(isturf(target))
@@ -301,6 +336,7 @@
damage_type = BURN
incendiary = 0.5
flammability = 2
hud_state = "pistol_fire"
/obj/item/projectile/bullet/incendiary/flamethrower
name = "ball of fire"
@@ -313,12 +349,14 @@
agony = 30
range = 4
vacuum_traversal = 0
hud_state = "flame"
/obj/item/projectile/bullet/incendiary/flamethrower/large
damage = 5
incendiary = 3
flammability = 2
range = 6
hud_state = "flame"
/obj/item/projectile/bullet/incendiary/flamethrower/tiny
damage = 2
@@ -328,11 +366,13 @@
modifier_duration = 20 SECONDS
range = 6
agony = 0
hud_state = "flame"
/* Practice rounds and blanks */
/obj/item/projectile/bullet/practice
damage = 5
hud_state = "smg_light"
/obj/item/projectile/bullet/pistol/cap // Just the primer, such as a cap gun.
name = "cap"
@@ -341,7 +381,8 @@
damage = 0
nodamage = 1
embed_chance = 0
sharp = 0
sharp = FALSE
hud_state = "monkey"
combustion = FALSE
@@ -356,7 +397,8 @@
damage = 0
nodamage = 1
embed_chance = 0
sharp = 0
sharp = FALSE
hud_state = "smg_light"
/obj/item/projectile/bullet/blank/cap/process()
loc = null
@@ -370,6 +412,7 @@
embed_chance = 0
sharp = FALSE
silenced = TRUE
hud_state = "pistol_light"
/obj/item/projectile/bullet/pellet/shotgun/bb // Shotgun
name = "BB"

View File

@@ -8,6 +8,8 @@
impact_effect_type = /obj/effect/temp_visual/impact_effect
hitsound_wall = 'sound/weapons/effects/searwall.ogg'
hitsound = 'sound/weapons/zapbang.ogg'
hud_state = "plasma"
hud_state_empty = "battery_empty"
var/flash_strength = 10
@@ -22,6 +24,7 @@
var/flash_range = 0
var/brightness = 7
var/light_colour = "#ffffff"
hud_state = "grenade_dummy"
/obj/item/projectile/energy/flash/on_impact(var/atom/A)
var/turf/T = flash_range? src.loc : get_turf(A)
@@ -59,6 +62,7 @@
flash_range = 1
brightness = 15
flash_strength = 20
hud_state = "grenade_dummy"
/obj/item/projectile/energy/flash/flare/on_impact(var/atom/A)
light_colour = pick("#e58775", "#ffffff", "#90ff90", "#a09030")
@@ -77,15 +81,18 @@
light_range = 2
light_power = 0.5
light_color = "#FFFFFF"
hud_state = "taser"
//Damage will be handled on the MOB side, to prevent window shattering.
/obj/item/projectile/energy/electrode/strong
agony = 55
hud_state = "taser"
/obj/item/projectile/energy/electrode/stunshot
name = "stunshot"
damage = 5
agony = 80
hud_state = "taser"
/obj/item/projectile/energy/declone
name = "declone"
@@ -100,6 +107,7 @@
impact_effect_type = /obj/effect/temp_visual/impact_effect/monochrome_laser
combustion = FALSE
hud_state = "plasma_pistol"
/obj/item/projectile/energy/excavate
name = "kinetic blast"
@@ -113,6 +121,7 @@
vacuum_traversal = 0
combustion = FALSE
hud_state = "plasma_blast"
/obj/item/projectile/energy/dart
name = "dart"
@@ -121,6 +130,7 @@
damage_type = TOX
agony = 120
check_armour = "energy"
hud_state = "pistol_tranq"
combustion = FALSE
@@ -131,10 +141,12 @@
damage_type = TOX
agony = 40
stutter = 10
hud_state = "electrothermal"
/obj/item/projectile/energy/bolt/large
name = "largebolt"
damage = 20
hud_state = "electrothermal"
/obj/item/projectile/energy/acid //Slightly up-gunned (Read: The thing does agony and checks bio resist) variant of the simple alien mob's projectile, for queens and sentinels.
name = "acidic spit"
@@ -155,6 +167,7 @@
agony = 80
check_armour = "bio"
armor_penetration = 25 // It's acid-based
hud_state = "electrothermal"
combustion = FALSE
@@ -164,6 +177,7 @@
damage = 20
damage_type = BIOACID
agony = 20
hud_state = "electrothermal"
check_armour = "bio"
armor_penetration = 25 // It's acid-based
@@ -193,6 +207,7 @@
light_power = 0.5
light_color = "#33CC00"
impact_effect_type = /obj/effect/temp_visual/impact_effect/monochrome_laser
hud_state = "plasma_rifle"
combustion = FALSE
@@ -206,6 +221,7 @@
agony = 55
damage_type = BURN
vacuum_traversal = 0 //Projectile disappears in empty space
hud_state = "plasma_rifle_blast"
/obj/item/projectile/energy/plasmastun/proc/bang(var/mob/living/carbon/M)
@@ -250,6 +266,7 @@
embed_chance = 0
muzzle_type = /obj/effect/projectile/muzzle/pulse
impact_effect_type = /obj/effect/temp_visual/impact_effect/monochrome_laser
hud_state = "plasma_sphere"
/obj/item/projectile/energy/phase
name = "phase wave"
@@ -258,17 +275,20 @@
range = 6
damage = 5
SA_bonus_damage = 45 // 50 total on animals
SA_vulnerability = SA_ANIMAL
hud_state = "laser_heat"
/obj/item/projectile/energy/phase/light
range = 4
SA_bonus_damage = 35 // 40 total on animals
hud_state = "laser_heat"
/obj/item/projectile/energy/phase/heavy
range = 8
SA_bonus_damage = 55 // 60 total on animals
hud_state = "laser_heat"
/obj/item/projectile/energy/phase/heavy/cannon
range = 10
damage = 15
SA_bonus_damage = 60 // 75 total on animals
SA_bonus_damage = 60 // 75 total on animals
hud_state = "laser_heat"

View File

@@ -7,6 +7,8 @@
icon_state = "missile"
damage = 30 //Meaty whack. *Chuckles*
does_spin = 0
hud_state = "rocket_he"
hud_state_empty = "rocket_empty"
/obj/item/projectile/bullet/srmrocket/on_hit(atom/target, blocked=0)
if(!isliving(target)) //if the target isn't alive, so is a wall or something
@@ -24,6 +26,7 @@
/obj/item/projectile/bullet/srmrocket/weak //Used in the jury rigged one.
damage = 10
hud_state = "rocket_he"
/obj/item/projectile/bullet/srmrocket/weak/on_hit(atom/target, blocked=0)
explosion(target, 0, 0, 2, 4)//No need to have a question.

View File

@@ -8,12 +8,14 @@
weaken = 1
penetrating = 5
armor_penetration = 70
hud_state = "alloy_spike"
/obj/item/projectile/bullet/magnetic/slug
name = "slug"
icon_state = "gauss_silenced"
damage = 75
armor_penetration = 90
hud_state = "alloy_spike"
/obj/item/projectile/bullet/magnetic/flechette
name = "flechette"
@@ -21,6 +23,7 @@
fire_sound = 'sound/weapons/rapidslice.ogg'
damage = 20
armor_penetration = 100
hud_state = "alloy_spike"
/obj/item/projectile/bullet/magnetic/flechette/small
name = "small flechette"
@@ -28,12 +31,14 @@
fire_sound = 'sound/weapons/rapidslice.ogg'
damage = 12
armor_penetration = 100
hud_state = "alloy_spike"
/obj/item/projectile/bullet/magnetic/flechette/hunting
name = "shredder slug"
armor_penetration = 30
SA_bonus_damage = 40
SA_vulnerability = SA_ANIMAL
hud_state = "alloy_spike"
/obj/item/projectile/bullet/magnetic/heated
name = "slug"
@@ -45,6 +50,7 @@
embed_chance = 0
armor_penetration = 40
penetrating = 1
hud_state = "alloy_spike"
/obj/item/projectile/bullet/magnetic/heated/weak
icon_state = "gauss_silenced"
@@ -53,6 +59,7 @@
embed_chance = 0
armor_penetration = 30
penetrating = 0
hud_state = "alloy_spike"
/obj/item/projectile/bullet/magnetic/fuelrod
name = "fuel rod"
@@ -67,6 +74,7 @@
embed_chance = 0
armor_penetration = 40
range = 20
hud_state = "rocket_he"
var/searing = 0 //Does this fuelrod ignore shields?
var/detonate_travel = 0 //Will this fuelrod explode when it reaches maximum distance?
@@ -113,6 +121,7 @@
flammability = -1
armor_penetration = 50
penetrating = 3
hud_state = "rocket_ap"
/obj/item/projectile/bullet/magnetic/fuelrod/phoron
name = "blazing fuel rod"
@@ -124,6 +133,7 @@
penetrating = 5
irradiate = 20
detonate_mob = 1
hud_state = "rocket_fire"
/obj/item/projectile/bullet/magnetic/fuelrod/supermatter
name = "painfully incandescent fuel rod"
@@ -140,6 +150,7 @@
detonate_travel = 1
detonate_mob = 1
energetic_impact = 1
hud_state = "rocket_thermobaric"
/obj/item/projectile/bullet/magnetic/fuelrod/supermatter/on_hit(var/atom/target, var/blocked = 0, var/def_zone = null) //You cannot touch the supermatter without disentigrating. Assumedly, this is true for condensed rods of it flying at relativistic speeds.
if(istype(target,/turf/simulated/wall) || istype(target,/mob/living))
@@ -160,6 +171,7 @@
check_armour = "melee"
irradiate = 20
range = 6
hud_state = "plasma_rifle_blast"
/obj/item/projectile/bullet/magnetic/bore/Initialize(loc, range_mod) // i'm gonna be real honest i dunno how this works but it does
. = ..()

View File

@@ -9,6 +9,8 @@
light_range = 2
light_power = 0.5
light_color = "#55AAFF"
hud_state = "plasma_blast"
hud_state_empty = "battery_empty"
combustion = FALSE
impact_effect_type = /obj/effect/temp_visual/impact_effect/ion
@@ -41,8 +43,9 @@
icon_state= "bolter"
damage = 50
check_armour = "bullet"
sharp = 1
edge = 1
sharp = TRUE
edge = TRUE
hud_state = "rocket_fire"
/obj/item/projectile/bullet/gyro/on_hit(var/atom/target, var/blocked = 0)
explosion(target, -1, 0, 2)
@@ -62,6 +65,7 @@
light_power = 0.5
light_color = "#55AAFF"
impact_effect_type = /obj/effect/temp_visual/impact_effect/monochrome_laser
hud_state = "water"
combustion = FALSE
@@ -93,6 +97,7 @@
/obj/item/projectile/temp/hot
name = "heat beam"
target_temperature = 1000
hud_state = "flame"
combustion = TRUE
@@ -104,6 +109,7 @@
damage_type = BRUTE
nodamage = 1
check_armour = "bullet"
hud_state = "monkey"
/obj/item/projectile/meteor/Bump(atom/A as mob|obj|turf|area)
if(A == firer)
@@ -140,6 +146,7 @@
impact_effect_type = /obj/effect/temp_visual/impact_effect/monochrome_laser
combustion = FALSE
hud_state = "electrothermal"
/obj/item/projectile/energy/floramut/on_hit(var/atom/target, var/blocked = 0)
var/mob/living/M = target
@@ -182,6 +189,7 @@
nodamage = 1
check_armour = "energy"
var/decl/plantgene/gene = null
hud_state = "electrothermal"
/obj/item/projectile/energy/florayield
name = "beta somatoray"
@@ -195,6 +203,7 @@
light_power = 0.5
light_color = "#FFFFFF"
impact_effect_type = /obj/effect/temp_visual/impact_effect/monochrome_laser
hud_state = "electrothermal"
/obj/item/projectile/energy/florayield/on_hit(var/atom/target, var/blocked = 0)
var/mob/living/M = target
@@ -212,6 +221,7 @@
name = "flayer ray"
combustion = FALSE
hud_state = "electrothermal"
/obj/item/projectile/beam/mindflayer/on_hit(var/atom/target, var/blocked = 0)
if(ishuman(target))
@@ -227,6 +237,7 @@
nodamage = 1
damage_type = HALLOSS
muzzle_type = /obj/effect/projectile/muzzle/bullet
hud_state = "monkey"
/obj/item/projectile/bola
name = "bola"
@@ -235,6 +246,7 @@
embed_chance = 0 //Nada.
damage_type = HALLOSS
muzzle_type = null
hud_state = "monkey"
combustion = FALSE
@@ -254,7 +266,7 @@
embed_chance = 0 //Nada.
damage_type = BRUTE
muzzle_type = null
hud_state = "monkey"
combustion = FALSE
/obj/item/projectile/webball/on_hit(var/atom/target, var/blocked = 0)
@@ -276,6 +288,7 @@
light_range = 4
light_power = 3
light_color = "#3300ff"
hud_state = "alloy_spike"
muzzle_type = /obj/effect/projectile/muzzle/tungsten
tracer_type = /obj/effect/projectile/tracer/tungsten