mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 21:48:39 +01:00
Pneumatic cannon optimization
This commit is contained in:
@@ -37,6 +37,9 @@
|
||||
return
|
||||
updateTank(W, 0, user)
|
||||
return
|
||||
if(W.type == type)
|
||||
user << "<span class='warning'>You're fairly certain that putting a pneumatic cannon inside another pneumatic cannon would cause a spacetime disruption.</span>"
|
||||
return
|
||||
if(istype(W, /obj/item/weapon/wrench))
|
||||
switch(pressureSetting)
|
||||
if(1)
|
||||
@@ -70,9 +73,22 @@
|
||||
return
|
||||
|
||||
|
||||
/obj/item/weapon/pneumatic_cannon/afterattack(atom/target as mob|obj|turf, mob/living/carbon/human/user as mob|obj, flag, params)
|
||||
if(user.a_intent == "harm" || !ishuman(user))
|
||||
/obj/item/weapon/pneumatic_cannon/afterattack(atom/target, mob/living/carbon/human/user, flag, params)
|
||||
if(istype(target, /obj/item/weapon/storage)) //So you can store it in backpacks
|
||||
return ..()
|
||||
if(istype(target, /obj/structure/closet)) //So you can store it in closets
|
||||
return ..()
|
||||
if(istype(target, /obj/structure/rack)) //So you can store it on racks
|
||||
return ..()
|
||||
if(!istype(user))
|
||||
return ..()
|
||||
Fire(user, target)
|
||||
|
||||
|
||||
/obj/item/weapon/pneumatic_cannon/proc/Fire(var/mob/living/carbon/human/user, var/turf/target_turf)
|
||||
if(!istype(user) && !target_turf)
|
||||
return
|
||||
var/discharge = 0
|
||||
if(is_in_gang(user, "Sleeping Carp"))
|
||||
user << "<span class='warning'>Use of ranged weaponry would bring dishonor to the clan.</span>"
|
||||
return
|
||||
@@ -85,20 +101,29 @@
|
||||
if(tank && !tank.air_contents.remove(gasPerThrow * pressureSetting))
|
||||
user << "<span class='warning'>\The [src] lets out a weak hiss and doesn't react!</span>"
|
||||
return
|
||||
user.visible_message("<span class='danger'>[user] fires \the [src]!</span>", \
|
||||
"<span class='warning'>You fire \the [src]!</span>")
|
||||
add_logs(user, target, "fired at", src)
|
||||
playsound(src.loc, 'sound/weapons/sonic_jackhammer.ogg', (50 * pressureSetting), 1)
|
||||
if(user.disabilities & CLUMSY && prob(25))
|
||||
user.visible_message("<span class='warning'>[user] loses their grip on [src], causing it to go off!</span>", \
|
||||
"<span class='userdanger'>[src] slips out of your hands and goes off!</span>")
|
||||
user.drop_item()
|
||||
if(prob(10))
|
||||
target_turf = get_turf(user)
|
||||
else
|
||||
for(var/turf/T in range(3,src))
|
||||
if(prob(25))
|
||||
target_turf = T
|
||||
discharge = 1
|
||||
if(!discharge)
|
||||
user.visible_message("<span class='danger'>[user] fires \the [src]!</span>", \
|
||||
"<span class='danger'>You fire \the [src]!</span>")
|
||||
add_logs(user, target_turf, "fired at", src)
|
||||
playsound(src.loc, 'sound/weapons/sonic_jackhammer.ogg', 50, 1)
|
||||
for(var/obj/item/ITD in loadedItems) //Item To Discharge
|
||||
spawn(0)
|
||||
loadedItems.Remove(ITD)
|
||||
loadedWeightClass -= ITD.w_class
|
||||
ITD.throw_speed = pressureSetting * 2
|
||||
ITD.loc = get_turf(src)
|
||||
ITD.throw_at(target, pressureSetting * 5, pressureSetting * 2,user)
|
||||
if(pressureSetting >= 3)
|
||||
user << "<span class='boldannounce'>\The [src]'s recoil knocks you down!</span>"
|
||||
user.Weaken(2)
|
||||
ITD.throw_at(target_turf, pressureSetting * 5, pressureSetting * 2,user)
|
||||
|
||||
|
||||
/obj/item/weapon/pneumatic_cannon/ghetto //Obtainable by improvised methods; more gas per use, less capacity, but smaller
|
||||
|
||||
Reference in New Issue
Block a user