12/21 modernizations from TG live (#103)
* sync (#3) * shuttle auto call * Merge /vore into /master (#39) * progress * Compile errors fixed No idea if it's test worthy tho as conflicts with race overhaul and narky removal. * Update admins.txt * efforts continue Fuck grab code, seriously * grab code is cancer * Execute the Narkism Do not hesitate. Show no mercy. * holy shit grab code is awful * have I bitched about grab code My bitching, let me show you it * código de agarre es una mierda No really it is * yeah I don't even know anymore. * Lolnope. Fuck grab code * I'm not even sure what to fix anymore * Self eating is not an acceptable fate * Taste the void, son. * My code doesn't pass it's own sanity check. Maybe it's a sign of things to come. * uncommented and notes * It Works and I Don't Know Why (#38) * shuttle auto call * it works and I don't know why * Subsystem 12/21 Most Recent TG subsystem folder * globalvars 12/21 Tossed out the flavor_misc and parallax files * Onclick 12/21 as well as .dme updates * _defines 12/21 ommited old _MC.dm * _HELPERS 12/21 Preserved snowflake placement of furry sprites * _defeines/genetics reapplied narkism holdover for snowflake races. * Oops forgot mutant colors * modules porting 12/21 + Sounds/icons Admin, Client and most of mob life files ommitted * enviroment file * Admin optimizations ahelp log system kept * Mob ports 12/21 Flavor text preserved * datums ported 12/21 * Game ported 12/21 * batch of duplicate fixes/dogborg work Dogborgs need to be modernized to refractored borg standards. * moar fixes * Maps and futher compile fixes
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
flags = CONDUCT
|
||||
slot_flags = SLOT_BELT
|
||||
throwforce = 0
|
||||
w_class = 1
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
var/fire_sound = null //What sound should play when this ammo is fired
|
||||
var/caliber = null //Which kind of guns it can be loaded into
|
||||
var/projectile_type = null //The bullet type to create when New() is called
|
||||
@@ -16,6 +16,8 @@
|
||||
var/randomspread = 0 //Randomspread for automatics
|
||||
var/delay = 0 //Delay for energy weapons
|
||||
var/click_cooldown_override = 0 //Override this to make your gun have a faster fire rate, in tenths of a second. 4 is the default gun cooldown.
|
||||
var/firing_effect_type = /obj/effect/overlay/temp/dir_setting/firing_effect //the visual effect appearing when the ammo is fired.
|
||||
|
||||
|
||||
/obj/item/ammo_casing/New()
|
||||
..()
|
||||
@@ -31,10 +33,10 @@
|
||||
icon_state = "[initial(icon_state)][BB ? "-live" : ""]"
|
||||
desc = "[initial(desc)][BB ? "" : " This one is spent"]"
|
||||
|
||||
/obj/item/ammo_casing/proc/newshot() //For energy weapons, shotgun shells and wands (!).
|
||||
if (!BB)
|
||||
//proc to magically refill a casing with a new projectile
|
||||
/obj/item/ammo_casing/proc/newshot() //For energy weapons, syringe gun, shotgun shells and wands (!).
|
||||
if(!BB)
|
||||
BB = new projectile_type(src)
|
||||
return
|
||||
|
||||
/obj/item/ammo_casing/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/ammo_box))
|
||||
@@ -55,113 +57,4 @@
|
||||
else
|
||||
user << "<span class='warning'>You fail to collect anything!</span>"
|
||||
else
|
||||
..()
|
||||
|
||||
//Boxes of ammo
|
||||
/obj/item/ammo_box
|
||||
name = "ammo box (null_reference_exception)"
|
||||
desc = "A box of ammo."
|
||||
icon_state = "357"
|
||||
icon = 'icons/obj/ammo.dmi'
|
||||
flags = CONDUCT
|
||||
slot_flags = SLOT_BELT
|
||||
item_state = "syringe_kit"
|
||||
materials = list(MAT_METAL=30000)
|
||||
throwforce = 2
|
||||
w_class = 1
|
||||
throw_speed = 3
|
||||
throw_range = 7
|
||||
var/list/stored_ammo = list()
|
||||
var/ammo_type = /obj/item/ammo_casing
|
||||
var/max_ammo = 7
|
||||
var/multiple_sprites = 0
|
||||
var/caliber
|
||||
var/multiload = 1
|
||||
|
||||
/obj/item/ammo_box/New()
|
||||
for(var/i = 1, i <= max_ammo, i++)
|
||||
stored_ammo += new ammo_type(src)
|
||||
update_icon()
|
||||
|
||||
/obj/item/ammo_box/proc/get_round(keep = 0)
|
||||
if (!stored_ammo.len)
|
||||
return null
|
||||
else
|
||||
var/b = stored_ammo[stored_ammo.len]
|
||||
stored_ammo -= b
|
||||
if (keep)
|
||||
stored_ammo.Insert(1,b)
|
||||
return b
|
||||
|
||||
/obj/item/ammo_box/proc/give_round(obj/item/ammo_casing/R, replace_spent = 0)
|
||||
// Boxes don't have a caliber type, magazines do. Not sure if it's intended or not, but if we fail to find a caliber, then we fall back to ammo_type.
|
||||
if(!R || (caliber && R.caliber != caliber) || (!caliber && R.type != ammo_type))
|
||||
return 0
|
||||
|
||||
if (stored_ammo.len < max_ammo)
|
||||
stored_ammo += R
|
||||
R.loc = src
|
||||
return 1
|
||||
|
||||
//for accessibles magazines (e.g internal ones) when full, start replacing spent ammo
|
||||
else if(replace_spent)
|
||||
for(var/obj/item/ammo_casing/AC in stored_ammo)
|
||||
if(!AC.BB)//found a spent ammo
|
||||
stored_ammo -= AC
|
||||
AC.loc = get_turf(src.loc)
|
||||
|
||||
stored_ammo += R
|
||||
R.loc = src
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
/obj/item/ammo_box/proc/can_load(mob/user)
|
||||
return 1
|
||||
|
||||
/obj/item/ammo_box/attackby(obj/item/A, mob/user, params, silent = 0, replace_spent = 0)
|
||||
var/num_loaded = 0
|
||||
if(!can_load(user))
|
||||
return
|
||||
if(istype(A, /obj/item/ammo_box))
|
||||
var/obj/item/ammo_box/AM = A
|
||||
for(var/obj/item/ammo_casing/AC in AM.stored_ammo)
|
||||
var/did_load = give_round(AC, replace_spent)
|
||||
if(did_load)
|
||||
AM.stored_ammo -= AC
|
||||
num_loaded++
|
||||
if(!did_load || !multiload)
|
||||
break
|
||||
if(istype(A, /obj/item/ammo_casing))
|
||||
var/obj/item/ammo_casing/AC = A
|
||||
if(give_round(AC, replace_spent))
|
||||
user.drop_item()
|
||||
AC.loc = src
|
||||
num_loaded++
|
||||
|
||||
if(num_loaded)
|
||||
if(!silent)
|
||||
user << "<span class='notice'>You load [num_loaded] shell\s into \the [src]!</span>"
|
||||
A.update_icon()
|
||||
update_icon()
|
||||
|
||||
return num_loaded
|
||||
|
||||
/obj/item/ammo_box/attack_self(mob/user)
|
||||
var/obj/item/ammo_casing/A = get_round()
|
||||
if(A)
|
||||
user.put_in_hands(A)
|
||||
user << "<span class='notice'>You remove a round from \the [src]!</span>"
|
||||
update_icon()
|
||||
|
||||
/obj/item/ammo_box/update_icon()
|
||||
switch(multiple_sprites)
|
||||
if(1)
|
||||
icon_state = "[initial(icon_state)]-[stored_ammo.len]"
|
||||
if(2)
|
||||
icon_state = "[initial(icon_state)]-[stored_ammo.len ? "[max_ammo]" : "0"]"
|
||||
desc = "[initial(desc)] There are [stored_ammo.len] shell\s left!"
|
||||
|
||||
//Behavior for magazines
|
||||
/obj/item/ammo_box/magazine/proc/ammo_count()
|
||||
return stored_ammo.len
|
||||
return ..()
|
||||
|
||||
Reference in New Issue
Block a user