Dart and Syringegun

This commit is contained in:
Fox-McCloud
2015-02-21 09:54:02 -05:00
parent 2a1028324c
commit edde2d10c6
8 changed files with 98 additions and 157 deletions
@@ -125,6 +125,11 @@
/obj/item/ammo_casing/shotgun/dart/attackby()
return
/obj/item/ammo_casing/syringegun
name = "syringe gun spring"
desc = "A high-power spring that throws syringes."
projectile_type = null
/obj/item/ammo_casing/shotgun/fakebeanbag
name = "beanbag shell"
desc = "A weak beanbag shell."
+10 -4
View File
@@ -24,18 +24,24 @@
return
/obj/item/weapon/gun/projectile/process_chambered()
/obj/item/weapon/gun/projectile/process_chambered(var/eject_casing = 1, var/empty_chamber = 1)
// if(in_chamber)
// return 1
var/obj/item/ammo_casing/AC = chambered //Find chambered round
if(isnull(AC) || !istype(AC))
return 0
AC.loc = get_turf(src) //Eject casing onto ground.
AC.SpinAnimation(10, 1) //next gen special effects
chambered = null
if(eject_casing)
AC.loc = get_turf(src) //Eject casing onto ground.
AC.SpinAnimation(10, 1) //next gen special effects
if(empty_chamber)
chambered = null
chamber_round()
if(AC.BB)
if(AC.reagents && AC.BB.reagents)
var/datum/reagents/casting_reagents = AC.reagents
casting_reagents.trans_to(AC.BB, casting_reagents.total_volume) //For chemical darts/bullets
casting_reagents.delete()
in_chamber = AC.BB //Load projectile into chamber.
AC.BB.loc = src //Set projectile loc to gun.
AC.update_icon()
@@ -12,18 +12,7 @@
return
/obj/item/weapon/gun/projectile/revolver/process_chambered()
var/obj/item/ammo_casing/AC = chambered //Find chambered round
if(isnull(AC) || !istype(AC))
return 0
chambered = null
chamber_round()
if(AC.BB)
in_chamber = AC.BB //Load projectile into chamber.
AC.BB.loc = src //Set projectile loc to gun.
AC.BB = null
AC.update_icon()
return 1
return 0
return ..(0, 1)
/obj/item/weapon/gun/projectile/revolver/attackby(var/obj/item/A as obj, mob/user as mob)
var/num_loaded = 0
@@ -36,21 +36,10 @@
/obj/item/weapon/gun/projectile/shotgun/process_chambered()
var/obj/item/ammo_casing/AC = chambered //Find chambered round
if(isnull(AC) || !istype(AC))
return 0
if(AC.BB)
if(AC.reagents && AC.BB.reagents)
var/datum/reagents/casting_reagents = AC.reagents
casting_reagents.trans_to(AC.BB, casting_reagents.total_volume) //For chemical darts
casting_reagents.delete()
in_chamber = AC.BB //Load projectile into chamber.
AC.BB.loc = src //Set projectile loc to gun.
AC.BB = null
AC.update_icon()
return 1
return 0
return ..(0, 0)
/obj/item/weapon/gun/projectile/shotgun/chamber_round()
return
/obj/item/weapon/gun/projectile/shotgun/attack_self(mob/living/user as mob)
if(recentpump) return
+12 -6
View File
@@ -75,7 +75,7 @@
proj_hit = 1
qdel(src)
proc/on_hit(var/atom/target, var/blocked = 0)
proc/on_hit(var/atom/target, var/blocked = 0, var/hit_zone)
if(!isliving(target)) return 0
if(isanimal(target)) return 0
var/mob/living/L = target
@@ -107,6 +107,12 @@
loc = A.loc
return 0// nope.avi
var/reagent_note
if(reagents && reagents.reagent_list)
reagent_note = " REAGENTS:"
for(var/datum/reagent/R in reagents.reagent_list)
reagent_note += R.id + " ("
reagent_note += num2text(R.volume) + ") "
//Lower accurancy/longer range tradeoff. Distance matters a lot here, so at
// close distance, actually RAISE the chance to hit.
var/distance = get_dist(get_turf(A), starting) // Get the distance between the turf shot from and the mob we hit and use that for the calculations.
@@ -124,18 +130,18 @@
playsound(loc, hitsound, 20, 1, -1)
visible_message("\red [A.name] is hit by the [src.name] in the [parse_zone(def_zone)]!")//X has fired Y is now given by the guns so you cant tell who shot you if you could not see the shooter
if(istype(firer, /mob))
M.attack_log += "\[[time_stamp()]\] <b>[firer]/[firer.ckey]</b> shot <b>[M]/[M.ckey]</b> with a <b>[src.type]</b>"
firer.attack_log += "\[[time_stamp()]\] <b>[firer]/[firer.ckey]</b> shot <b>[M]/[M.ckey]</b> with a <b>[src.type]</b>"
M.attack_log += "\[[time_stamp()]\] <b>[firer]/[firer.ckey]</b> shot <b>[M]/[M.ckey]</b> with a <b>[src.type]</b>[reagent_note]"
firer.attack_log += "\[[time_stamp()]\] <b>[firer]/[firer.ckey]</b> shot <b>[M]/[M.ckey]</b> with a <b>[src.type]</b>[reagent_note]"
if(M.ckey && chatlog_attacks)
msg_admin_attack("[firer] ([firer.ckey]) shot [M] ([M.ckey]) with a [src] (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[firer.x];Y=[firer.y];Z=[firer.z]'>JMP</a>)") //BS12 EDIT ALG
msg_admin_attack("[firer] ([firer.ckey]) shot [M] ([M.ckey]) with a [src][reagent_note] (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[firer.x];Y=[firer.y];Z=[firer.z]'>JMP</a>)") //BS12 EDIT ALG
if(!iscarbon(firer))
M.LAssailant = null
else
M.LAssailant = firer
else
M.attack_log += "\[[time_stamp()]\] <b>UNKNOWN SUBJECT (No longer exists)</b> shot <b>[M]/[M.ckey]</b> with a <b>[src]</b>"
M.attack_log += "\[[time_stamp()]\] <b>UNKNOWN SUBJECT (No longer exists)</b> shot <b>[M]/[M.ckey]</b> with a <b>[src]</b>[reagent_note]"
if(M.ckey && chatlog_attacks)
msg_admin_attack("UNKNOWN shot [M] ([M.ckey]) with a [src] (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[firer.x];Y=[firer.y];Z=[firer.z]'>JMP</a>)") //BS12 EDIT ALG
msg_admin_attack("UNKNOWN shot [M] ([M.ckey]) with a [src][reagent_note] (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[firer.x];Y=[firer.y];Z=[firer.z]'>JMP</a>)") //BS12 EDIT ALG
spawn(0)
if(A)
@@ -144,6 +144,8 @@
name = "dart"
icon_state = "cbbolt"
damage = 6
embed = 0
sharp = 0
New()
..()