mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
Adminspawn-only proc call gun (#31732)
* Adminspawn-only proc call gun * Can't forget this * Let there be gunk * Here too * Here too * This is nicer * Less messy in some cases * Should be this permission to be consistent Co-authored-by: kanef <kanef9x@protonmail.com>
This commit is contained in:
@@ -37,6 +37,7 @@ var/list/fuckup_step = list('sound/effects/fuckupstep1.ogg', 'sound/effects/fuck
|
|||||||
var/list/jingle_sound = list('sound/items/jinglebell1.ogg', 'sound/items/jinglebell2.ogg', 'sound/items/jinglebell3.ogg')
|
var/list/jingle_sound = list('sound/items/jinglebell1.ogg', 'sound/items/jinglebell2.ogg', 'sound/items/jinglebell3.ogg')
|
||||||
var/list/disappear_sound = list('sound/effects/disappear_1.ogg', 'sound/effects/disappear_2.ogg', 'sound/effects/disappear_3.ogg')
|
var/list/disappear_sound = list('sound/effects/disappear_1.ogg', 'sound/effects/disappear_2.ogg', 'sound/effects/disappear_3.ogg')
|
||||||
var/list/pd_wail_sound = list('sound/voice/pdwail1.ogg', 'sound/voice/pdwail2.ogg', 'sound/voice/pdwail3.ogg')
|
var/list/pd_wail_sound = list('sound/voice/pdwail1.ogg', 'sound/voice/pdwail2.ogg', 'sound/voice/pdwail3.ogg')
|
||||||
|
var/list/procgun_sound = list('sound/weapons/procgun1.ogg', 'sound/weapons/procgun2.ogg')
|
||||||
//var/list/gun_sound = list('sound/weapons/Gunshot.ogg', 'sound/weapons/Gunshot2.ogg','sound/weapons/Gunshot3.ogg','sound/weapons/Gunshot4.ogg')
|
//var/list/gun_sound = list('sound/weapons/Gunshot.ogg', 'sound/weapons/Gunshot2.ogg','sound/weapons/Gunshot3.ogg','sound/weapons/Gunshot4.ogg')
|
||||||
|
|
||||||
//gas_modified controls if a sound is affected by how much gas there is in the atmosphere of the source
|
//gas_modified controls if a sound is affected by how much gas there is in the atmosphere of the source
|
||||||
@@ -239,5 +240,7 @@ var/const/SURROUND_CAP = 7
|
|||||||
soundin = pick(disappear_sound)
|
soundin = pick(disappear_sound)
|
||||||
if ("pd_wail_sound")
|
if ("pd_wail_sound")
|
||||||
soundin = pick(pd_wail_sound)
|
soundin = pick(pd_wail_sound)
|
||||||
|
if ("procgun_sound")
|
||||||
|
soundin = pick(procgun_sound)
|
||||||
//if ("gunshot") soundin = pick(gun_sound)
|
//if ("gunshot") soundin = pick(gun_sound)
|
||||||
return soundin
|
return soundin
|
||||||
|
|||||||
@@ -1332,24 +1332,36 @@ var/global/floorIsLava = 0
|
|||||||
var/chosen = filter_list_input("Select an atom type", "Spawn Atom", get_matching_types(object, /atom))
|
var/chosen = filter_list_input("Select an atom type", "Spawn Atom", get_matching_types(object, /atom))
|
||||||
if(!chosen)
|
if(!chosen)
|
||||||
return
|
return
|
||||||
|
var/atom/location = usr.loc
|
||||||
//preloader is hooked to atom/New(), and is automatically disabled once it 'loads' an object
|
location.spawn_at(chosen, varchanges)
|
||||||
_preloader.setup(varchanges, chosen)
|
|
||||||
|
|
||||||
if(ispath(chosen,/turf))
|
|
||||||
var/turf/T = get_turf(usr.loc)
|
|
||||||
T.ChangeTurf(chosen)
|
|
||||||
else if(ispath(chosen, /area))
|
|
||||||
var/area/A = locate(chosen)
|
|
||||||
var/turf/T = get_turf(usr.loc)
|
|
||||||
|
|
||||||
T.set_area(A)
|
|
||||||
else
|
|
||||||
new chosen(usr.loc)
|
|
||||||
|
|
||||||
log_admin("[key_name(usr)] spawned [chosen] at ([usr.x],[usr.y],[usr.z])")
|
log_admin("[key_name(usr)] spawned [chosen] at ([usr.x],[usr.y],[usr.z])")
|
||||||
feedback_add_details("admin_verb","SA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
feedback_add_details("admin_verb","SA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||||
|
|
||||||
|
// Helper functions for proc call madness
|
||||||
|
/atom/proc/spawn_at(var/type, var/list/varchanges = list())
|
||||||
|
if(!ispath(type))
|
||||||
|
return
|
||||||
|
//preloader is hooked to atom/New(), and is automatically disabled once it 'loads' an object
|
||||||
|
_preloader.setup(varchanges, type)
|
||||||
|
|
||||||
|
if(ispath(type,/turf))
|
||||||
|
var/turf/T = get_turf(src)
|
||||||
|
T.ChangeTurf(type)
|
||||||
|
else if(ispath(type, /area))
|
||||||
|
var/area/A = locate(type)
|
||||||
|
var/turf/T = get_turf(src)
|
||||||
|
|
||||||
|
T.set_area(A)
|
||||||
|
else
|
||||||
|
new type(src)
|
||||||
|
|
||||||
|
/atom/proc/spawn_at_turf(var/type, var/list/varchanges = list())
|
||||||
|
if(isarea(src))
|
||||||
|
return
|
||||||
|
var/turf/T = get_turf(src)
|
||||||
|
T.spawn_at(type,varchanges)
|
||||||
|
|
||||||
/datum/admins/proc/show_role_panel(var/mob/M in mob_list)
|
/datum/admins/proc/show_role_panel(var/mob/M in mob_list)
|
||||||
set category = "Admin"
|
set category = "Admin"
|
||||||
set desc = "Edit mobs's Job, Roles, and Factions"
|
set desc = "Edit mobs's Job, Roles, and Factions"
|
||||||
|
|||||||
62
code/modules/projectiles/guns/procgun.dm
Normal file
62
code/modules/projectiles/guns/procgun.dm
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
/obj/item/weapon/gun/procgun
|
||||||
|
desc = "Oh no..."
|
||||||
|
name = "proc gun"
|
||||||
|
icon = 'icons/obj/device.dmi'
|
||||||
|
icon_state = "eftpos" // We gmod now (looks like toolgun)
|
||||||
|
w_class = W_CLASS_SMALL
|
||||||
|
recoil = 0
|
||||||
|
fire_delay = 0
|
||||||
|
fire_sound = "procgun_sound"
|
||||||
|
var/procname
|
||||||
|
var/list/procargs = list()
|
||||||
|
var/static/list/bad_procs = list("gib","ex_act","singularity_act","death")
|
||||||
|
|
||||||
|
/obj/item/weapon/gun/procgun/attack_self(mob/user)
|
||||||
|
if(!user.check_rights(R_DEBUG))
|
||||||
|
to_chat(user,"<span class='warning'>You do not have the divine authority to modify what this gun does.</span>")
|
||||||
|
return
|
||||||
|
|
||||||
|
procname = input("Proc path to call on target hit, eg: /proc/fake_blood","Path:", null) as text|null
|
||||||
|
if(!procname)
|
||||||
|
return
|
||||||
|
|
||||||
|
var/argnum = input("Number of arguments","Number:",0) as num|null
|
||||||
|
if(!argnum && (argnum!=0))
|
||||||
|
return
|
||||||
|
|
||||||
|
procargs.len = argnum // Expand to right length
|
||||||
|
|
||||||
|
var/i
|
||||||
|
for(i = 1, i < argnum + 1, i++) // Lists indexed from 1 forwards in byond
|
||||||
|
procargs[i] = variable_set(user.client)
|
||||||
|
|
||||||
|
if(procname in bad_procs)
|
||||||
|
desc = "RUN!!!"
|
||||||
|
else
|
||||||
|
desc = "Oh no..."
|
||||||
|
|
||||||
|
process_chambered()
|
||||||
|
|
||||||
|
/obj/item/weapon/gun/procgun/process_chambered()
|
||||||
|
if(!in_chamber)
|
||||||
|
in_chamber = new/obj/item/projectile/beam/procjectile(src)
|
||||||
|
var/obj/item/projectile/beam/procjectile/P = in_chamber
|
||||||
|
P.procname = procname
|
||||||
|
P.procargs = procargs.Copy()
|
||||||
|
return 1
|
||||||
|
|
||||||
|
/obj/item/projectile/beam/procjectile
|
||||||
|
name = "proc beam"
|
||||||
|
icon = 'icons/obj/projectiles_experimental.dmi'
|
||||||
|
icon_state = "procg"
|
||||||
|
damage = 0
|
||||||
|
nodamage = TRUE
|
||||||
|
fire_sound = "procgun_sound"
|
||||||
|
var/procname
|
||||||
|
var/list/procargs = list()
|
||||||
|
|
||||||
|
/obj/item/projectile/beam/procjectile/to_bump(atom/A)
|
||||||
|
if(procname)
|
||||||
|
spawn(1)
|
||||||
|
call(A,procname)(arglist(procargs))
|
||||||
|
return ..()
|
||||||
@@ -25,6 +25,7 @@
|
|||||||
/obj/item/projectile/hookshot,
|
/obj/item/projectile/hookshot,
|
||||||
/obj/item/projectile/bullet/blastwave,
|
/obj/item/projectile/bullet/blastwave,
|
||||||
/obj/item/projectile/beam/lightning,
|
/obj/item/projectile/beam/lightning,
|
||||||
|
/obj/item/projectile/beam/procjectile,
|
||||||
/obj/item/projectile/beam/lightning/spell,
|
/obj/item/projectile/beam/lightning/spell,
|
||||||
/obj/item/projectile/rocket/nikita,
|
/obj/item/projectile/rocket/nikita,
|
||||||
/obj/item/projectile/test,
|
/obj/item/projectile/test,
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
BIN
sound/weapons/procgun1.ogg
Normal file
BIN
sound/weapons/procgun1.ogg
Normal file
Binary file not shown.
BIN
sound/weapons/procgun2.ogg
Normal file
BIN
sound/weapons/procgun2.ogg
Normal file
Binary file not shown.
@@ -2059,9 +2059,6 @@
|
|||||||
#include "code\modules\mob\living\simple_animal\hostile\necro.dm"
|
#include "code\modules\mob\living\simple_animal\hostile\necro.dm"
|
||||||
#include "code\modules\mob\living\simple_animal\hostile\necromorph.dm"
|
#include "code\modules\mob\living\simple_animal\hostile\necromorph.dm"
|
||||||
#include "code\modules\mob\living\simple_animal\hostile\pitbull.dm"
|
#include "code\modules\mob\living\simple_animal\hostile\pitbull.dm"
|
||||||
#include "code\modules\mob\living\simple_animal\hostile\pulse_demon\pulsedemon.dm"
|
|
||||||
#include "code\modules\mob\living\simple_animal\hostile\pulse_demon\pulsedemon_attack.dm"
|
|
||||||
#include "code\modules\mob\living\simple_animal\hostile\pulse_demon\pulsedemon_powers.dm"
|
|
||||||
#include "code\modules\mob\living\simple_animal\hostile\rattlemebones.dm"
|
#include "code\modules\mob\living\simple_animal\hostile\rattlemebones.dm"
|
||||||
#include "code\modules\mob\living\simple_animal\hostile\scp_173.dm"
|
#include "code\modules\mob\living\simple_animal\hostile\scp_173.dm"
|
||||||
#include "code\modules\mob\living\simple_animal\hostile\shade.dm"
|
#include "code\modules\mob\living\simple_animal\hostile\shade.dm"
|
||||||
@@ -2094,6 +2091,9 @@
|
|||||||
#include "code\modules\mob\living\simple_animal\hostile\human\tajaran.dm"
|
#include "code\modules\mob\living\simple_animal\hostile\human\tajaran.dm"
|
||||||
#include "code\modules\mob\living\simple_animal\hostile\human\vox.dm"
|
#include "code\modules\mob\living\simple_animal\hostile\human\vox.dm"
|
||||||
#include "code\modules\mob\living\simple_animal\hostile\human\wizard.dm"
|
#include "code\modules\mob\living\simple_animal\hostile\human\wizard.dm"
|
||||||
|
#include "code\modules\mob\living\simple_animal\hostile\pulse_demon\pulsedemon.dm"
|
||||||
|
#include "code\modules\mob\living\simple_animal\hostile\pulse_demon\pulsedemon_attack.dm"
|
||||||
|
#include "code\modules\mob\living\simple_animal\hostile\pulse_demon\pulsedemon_powers.dm"
|
||||||
#include "code\modules\mob\living\simple_animal\hostile\retaliate\clown.dm"
|
#include "code\modules\mob\living\simple_animal\hostile\retaliate\clown.dm"
|
||||||
#include "code\modules\mob\living\simple_animal\hostile\retaliate\cluwne.dm"
|
#include "code\modules\mob\living\simple_animal\hostile\retaliate\cluwne.dm"
|
||||||
#include "code\modules\mob\living\simple_animal\hostile\retaliate\cockatrice.dm"
|
#include "code\modules\mob\living\simple_animal\hostile\retaliate\cockatrice.dm"
|
||||||
@@ -2263,6 +2263,7 @@
|
|||||||
#include "code\modules\projectiles\guns\hookshot.dm"
|
#include "code\modules\projectiles\guns\hookshot.dm"
|
||||||
#include "code\modules\projectiles\guns\lawgiver.dm"
|
#include "code\modules\projectiles\guns\lawgiver.dm"
|
||||||
#include "code\modules\projectiles\guns\portalgun.dm"
|
#include "code\modules\projectiles\guns\portalgun.dm"
|
||||||
|
#include "code\modules\projectiles\guns\procgun.dm"
|
||||||
#include "code\modules\projectiles\guns\projectile.dm"
|
#include "code\modules\projectiles\guns\projectile.dm"
|
||||||
#include "code\modules\projectiles\guns\energy\disintegrator.dm"
|
#include "code\modules\projectiles\guns\energy\disintegrator.dm"
|
||||||
#include "code\modules\projectiles\guns\energy\gravitywell.dm"
|
#include "code\modules\projectiles\guns\energy\gravitywell.dm"
|
||||||
|
|||||||
Reference in New Issue
Block a user