From 0173c7af6ebd03b681b81f5cf20347a16fff0c91 Mon Sep 17 00:00:00 2001 From: Fayrik Date: Sat, 21 Mar 2015 16:18:32 +0000 Subject: [PATCH] Adds everything and makes it all work perfectly. It's like I'm almost good at this or something. (Seriously, points of interest: Secbots react to being shot. Dart rigging. Donksoft guns.) --- code/game/machinery/bots/ed209bot.dm | 24 ++++++++-------- code/game/machinery/bots/secbot.dm | 25 +++++++++-------- code/game/objects/items.dm | 1 + code/game/objects/items/weapons/melee/misc.dm | 4 +++ code/modules/projectiles/ammunition.dm | 2 +- .../projectiles/ammunition/ammo_casings.dm | 23 ++++++++++++++++ .../projectiles/ammunition/magazines.dm | 20 ++++++++++++++ code/modules/projectiles/gun.dm | 1 + code/modules/projectiles/guns/energy/laser.dm | 3 ++ .../projectiles/guns/energy/special.dm | 1 + .../projectiles/guns/projectile/toy.dm | 26 +++++++++++++++++- .../projectiles/projectile/reusable.dm | 2 +- html/changelogs/Fayrik-FoamForceFuckYeah.yml | 8 ++++-- icons/obj/guns/toy.dmi | Bin 1400 -> 2393 bytes 14 files changed, 111 insertions(+), 29 deletions(-) diff --git a/code/game/machinery/bots/ed209bot.dm b/code/game/machinery/bots/ed209bot.dm index faf974bb6dbf..b40ce18057a7 100644 --- a/code/game/machinery/bots/ed209bot.dm +++ b/code/game/machinery/bots/ed209bot.dm @@ -37,14 +37,6 @@ bot_type = SEC_BOT bot_filter = RADIO_SECBOT - //List of weapons that secbots will not arrest for - var/safe_weapons = list(\ - /obj/item/weapon/gun/energy/laser/bluetag,\ - /obj/item/weapon/gun/energy/laser/redtag,\ - /obj/item/weapon/gun/energy/laser/practice,\ - /obj/item/weapon/melee/classic_baton/telescopic,\ - /obj/item/weapon/gun/energy/kinetic_accelerator) - /obj/item/weapon/ed209_assembly name = "\improper ED-209 assembly" @@ -206,6 +198,17 @@ Auto Patrol[]"}, icon_state = "[lasercolor]ed209[on]" set_weapon() +/obj/machinery/bot/ed209/bullet_act(var/obj/item/projectile/Proj) + if(istype(Proj ,/obj/item/projectile/beam)||istype(Proj,/obj/item/projectile/bullet)) + if((Proj.damage_type == BURN) || (Proj.damage_type == BRUTE)) + if (!Proj.nodamage && Proj.damage < src.health) + threatlevel = Proj.firer.assess_threat(src) + threatlevel += 6 + if(threatlevel >= 4) + target = Proj.firer + mode = BOT_HUNT + ..() + /obj/machinery/bot/ed209/bot_process() if (!..()) return @@ -392,9 +395,8 @@ Auto Patrol[]"}, continue /obj/machinery/bot/ed209/proc/check_for_weapons(var/obj/item/slot_item) - if(istype(slot_item, /obj/item/weapon/gun) || istype(slot_item, /obj/item/weapon/melee)) - if(!(slot_item.type in safe_weapons)) - return 1 + if(slot_item && slot_item.needs_permit) + return 1 return 0 /* terrible diff --git a/code/game/machinery/bots/secbot.dm b/code/game/machinery/bots/secbot.dm index 1204393f095c..8a4ea246327a 100644 --- a/code/game/machinery/bots/secbot.dm +++ b/code/game/machinery/bots/secbot.dm @@ -27,15 +27,6 @@ bot_type = SEC_BOT bot_filter = RADIO_SECBOT - //List of weapons that secbots will not arrest for - var/safe_weapons = list(\ - /obj/item/weapon/gun/energy/laser/bluetag,\ - /obj/item/weapon/gun/energy/laser/redtag,\ - /obj/item/weapon/gun/energy/laser/practice,\ - /obj/item/weapon/melee/classic_baton/telescopic,\ - /obj/item/weapon/gun/energy/kinetic_accelerator) - - /obj/machinery/bot/secbot/beepsky name = "Officer Beep O'sky" desc = "It's Officer Beep O'sky! Powered by a potato and a shot of whiskey." @@ -189,6 +180,17 @@ Auto Patrol: []"}, declare_arrests = 0 icon_state = "secbot[on]" +/obj/machinery/bot/secbot/bullet_act(var/obj/item/projectile/Proj) + if(istype(Proj ,/obj/item/projectile/beam)||istype(Proj,/obj/item/projectile/bullet)) + if((Proj.damage_type == BURN) || (Proj.damage_type == BRUTE)) + if (!Proj.nodamage && Proj.damage < src.health) + threatlevel = Proj.firer.assess_threat(src) + threatlevel += 6 + if(threatlevel >= 4) + target = Proj.firer + mode = BOT_HUNT + ..() + /obj/machinery/bot/secbot/bot_process() if (!..()) return @@ -350,9 +352,8 @@ Auto Patrol: []"}, else continue /obj/machinery/bot/secbot/proc/check_for_weapons(var/obj/item/slot_item) - if(istype(slot_item, /obj/item/weapon/gun) || istype(slot_item, /obj/item/weapon/melee)) - if(!(slot_item.type in safe_weapons)) - return 1 + if(slot_item && slot_item.needs_permit) + return 1 return 0 /obj/machinery/bot/secbot/explode() diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 6786b641c531..bb515cb2b8ef 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -43,6 +43,7 @@ var/g_amt = 0 // glass var/reliability = 100 //Used by SOME devices to determine how reliable they are. var/origin_tech = null //Used by R&D to determine what research bonuses it grants. + var/needs_permit = 0 //Used by security bots to determine if this item is safe for public use. var/list/attack_verb = list() //Used in attackby() to say how something was attacked "[x] has been [z.attack_verb] by [y] with [z]" var/list/species_exception = list() // even if a species cannot put items in a certain slot, if the species id is in the item's exception list, it will be able to wear that item diff --git a/code/game/objects/items/weapons/melee/misc.dm b/code/game/objects/items/weapons/melee/misc.dm index 134205787040..fa3463342789 100644 --- a/code/game/objects/items/weapons/melee/misc.dm +++ b/code/game/objects/items/weapons/melee/misc.dm @@ -1,3 +1,6 @@ +/obj/item/weapon/melee + needs_permit = 1 + /obj/item/weapon/melee/chainofcommand name = "chain of command" desc = "A tool used by great men to placate the frothing masses." @@ -79,6 +82,7 @@ item_state = null slot_flags = SLOT_BELT w_class = 2 + needs_permit = 0 force = 0 on = 0 diff --git a/code/modules/projectiles/ammunition.dm b/code/modules/projectiles/ammunition.dm index 2fd24f740c36..5ff242be8aa6 100644 --- a/code/modules/projectiles/ammunition.dm +++ b/code/modules/projectiles/ammunition.dm @@ -42,7 +42,7 @@ for(var/obj/item/ammo_casing/bullet in src.loc) if (box.stored_ammo.len >= box.max_ammo) break - if (box.ammo_type == bullet.type && bullet.BB) + if (bullet.BB) if (box.give_round(bullet, 0)) boolets++ else diff --git a/code/modules/projectiles/ammunition/ammo_casings.dm b/code/modules/projectiles/ammunition/ammo_casings.dm index fe6a501926bd..e26c9b31e92b 100644 --- a/code/modules/projectiles/ammunition/ammo_casings.dm +++ b/code/modules/projectiles/ammunition/ammo_casings.dm @@ -216,6 +216,29 @@ caliber = "foam_force" icon = 'icons/obj/guns/toy.dmi' icon_state = "foamdart" + var/modified = 0 + +/obj/item/ammo_casing/caseless/foam_dart/update_icon() + ..() + if (modified) + icon_state = "foamdart_empty" + desc = "Its nerf or nothing! ...Although, this one doesn't look too safe." + +/obj/item/ammo_casing/caseless/foam_dart/attackby(var/obj/item/A as obj, mob/user as mob, params) + ..() + if (istype(A, /obj/item/weapon/screwdriver) && !modified) + modified = 1 + BB.damage_type = BRUTE + icon_state = "foamdart_empty" + desc = "Its nerf or nothing! ...Although, this one doesn't look too safe." + user << "You pop the safety cap off of [src]." + else if ((istype(A, /obj/item/weapon/pen)) && modified && !BB.contents.len) + user.drop_item() + A.loc = BB + BB.damage = 5 + BB.nodamage = 0 + user << "You insert [A] into [src]." + return /obj/item/ammo_casing/caseless/foam_dart/riot name = "riot foam dart" diff --git a/code/modules/projectiles/ammunition/magazines.dm b/code/modules/projectiles/ammunition/magazines.dm index 6a605ad218a3..b1296f8b2cf8 100644 --- a/code/modules/projectiles/ammunition/magazines.dm +++ b/code/modules/projectiles/ammunition/magazines.dm @@ -250,3 +250,23 @@ obj/item/ammo_box/magazine/tommygunm45 /obj/item/ammo_box/magazine/toy/pistol/riot ammo_type = /obj/item/ammo_casing/caseless/foam_dart/riot + +/obj/item/ammo_box/magazine/toy/smgm45 + name = "donksoft SMG magazine" + caliber = "foam_force" + ammo_type = /obj/item/ammo_casing/caseless/foam_dart/riot + max_ammo = 20 + +/obj/item/ammo_box/magazine/toy/smgm45/update_icon() + ..() + icon_state = "c20r45-[round(ammo_count(),2)]" + +/obj/item/ammo_box/magazine/toy/m762 + name = "donksoft box magazine" + caliber = "foam_force" + ammo_type = /obj/item/ammo_casing/caseless/foam_dart/riot + max_ammo = 50 + +/obj/item/ammo_box/magazine/toy/m762/update_icon() + ..() + icon_state = "a762-[round(ammo_count(),10)]" \ No newline at end of file diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 9b14f51bf4d5..4139a3e348c6 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -17,6 +17,7 @@ throw_range = 5 force = 5.0 origin_tech = "combat=1" + needs_permit = 1 attack_verb = list("struck", "hit", "bashed") var/fire_sound = "gunshot" diff --git a/code/modules/projectiles/guns/energy/laser.dm b/code/modules/projectiles/guns/energy/laser.dm index d255add40284..f1e7f779d14c 100644 --- a/code/modules/projectiles/guns/energy/laser.dm +++ b/code/modules/projectiles/guns/energy/laser.dm @@ -14,6 +14,7 @@ desc = "A modified version of the basic laser gun, this one fires less concentrated energy bolts designed for target practice." ammo_type = list(/obj/item/ammo_casing/energy/laser/practice) clumsy_check = 0 + needs_permit = 0 obj/item/weapon/gun/energy/laser/retro name ="retro laser" @@ -105,6 +106,7 @@ obj/item/weapon/gun/energy/laser/retro ammo_type = list(/obj/item/ammo_casing/energy/laser/bluetag) origin_tech = "combat=1;magnets=2" clumsy_check = 0 + needs_permit = 0 var/charge_tick = 0 pin = /obj/item/device/firing_pin/tag/blue @@ -135,6 +137,7 @@ obj/item/weapon/gun/energy/laser/retro ammo_type = list(/obj/item/ammo_casing/energy/laser/redtag) origin_tech = "combat=1;magnets=2" clumsy_check = 0 + needs_permit = 0 var/charge_tick = 0 pin = /obj/item/device/firing_pin/tag/red diff --git a/code/modules/projectiles/guns/energy/special.dm b/code/modules/projectiles/guns/energy/special.dm index 96822335fcee..ec025ada1766 100644 --- a/code/modules/projectiles/guns/energy/special.dm +++ b/code/modules/projectiles/guns/energy/special.dm @@ -123,6 +123,7 @@ item_state = "kineticgun" ammo_type = list(/obj/item/ammo_casing/energy/kinetic) cell_type = "/obj/item/weapon/stock_parts/cell/emproof" + needs_permit = 0 // Aparently these are safe to carry? I'm sure Golliaths would disagree. var/overheat = 0 var/recent_reload = 1 var/range_add = 0 diff --git a/code/modules/projectiles/guns/projectile/toy.dm b/code/modules/projectiles/guns/projectile/toy.dm index b0e1c5cec0fd..d1da2b67d884 100644 --- a/code/modules/projectiles/guns/projectile/toy.dm +++ b/code/modules/projectiles/guns/projectile/toy.dm @@ -11,6 +11,7 @@ burst_size = 3 can_suppress = 0 clumsy_check = 0 + needs_permit = 0 /obj/item/weapon/gun/projectile/automatic/toy/process_chamber(var/eject_casing = 0, var/empty_chamber = 1) ..() @@ -40,6 +41,7 @@ origin_tech = null mag_type = /obj/item/ammo_box/magazine/internal/shot/toy clumsy_check = 0 + needs_permit = 0 /obj/item/weapon/gun/projectile/shotgun/toy/process_chamber() ..() @@ -55,4 +57,26 @@ mag_type = /obj/item/ammo_box/magazine/internal/shot/toy/crossbow fire_sound = 'sound/items/syringeproj.ogg' slot_flags = SLOT_BELT - w_class = 2 \ No newline at end of file + w_class = 2 + +/obj/item/weapon/gun/projectile/automatic/c20r/toy + name = "donksoft SMG" + desc = "A bullpup two-round burst toy SMG, designated 'C-20r'. Ages 8 and up." + icon = 'icons/obj/guns/toy.dmi' + can_suppress = 0 + needs_permit = 0 + mag_type = /obj/item/ammo_box/magazine/toy/smgm45 + +/obj/item/weapon/gun/projectile/automatic/c20r/toy/process_chamber(var/eject_casing = 0, var/empty_chamber = 1) + ..() + +/obj/item/weapon/gun/projectile/automatic/l6_saw/toy + name = "donksoft LMG" + desc = "A heavily modified toy light machine gun, designated 'L6 SAW'. Ages 8 and up." + icon = 'icons/obj/guns/toy.dmi' + can_suppress = 0 + needs_permit = 0 + mag_type = /obj/item/ammo_box/magazine/toy/m762 + +/obj/item/weapon/gun/projectile/automatic/l6_saw/toy/process_chamber(var/eject_casing = 0, var/empty_chamber = 1) + ..() \ No newline at end of file diff --git a/code/modules/projectiles/projectile/reusable.dm b/code/modules/projectiles/projectile/reusable.dm index 118a9c60a1de..0e9d010d3fe7 100644 --- a/code/modules/projectiles/projectile/reusable.dm +++ b/code/modules/projectiles/projectile/reusable.dm @@ -37,7 +37,7 @@ damage = 0 // It's a damn toy. damage_type = OXY nodamage = 1 - icon = 'icons/obj/toy.dmi' + icon = 'icons/obj/guns/toy.dmi' icon_state = "foamdart" ammo_type = /obj/item/ammo_casing/caseless/foam_dart range = 10 diff --git a/html/changelogs/Fayrik-FoamForceFuckYeah.yml b/html/changelogs/Fayrik-FoamForceFuckYeah.yml index 74e052e8bf09..fab63cad6441 100644 --- a/html/changelogs/Fayrik-FoamForceFuckYeah.yml +++ b/html/changelogs/Fayrik-FoamForceFuckYeah.yml @@ -7,6 +7,8 @@ changes: - rscadd: "Added an abstract new type of reusable ammo." - rscadd: "Added three new foam force guns and a foam force crossbow, all of which take the new foam dart ammo." - rscadd: "Added foam force dart boxes to the autolathe, and two crates orderable from cargo containing the new guns." - - rscadd: "New crossbow can be won as an arcade prize." - - rscadd: "All kinds of ammo containers can now be used to rapidly collect live ammunition on the ground." - - rscadd: "Speedloaders and traditional ammo boxes can now be restocked." \ No newline at end of file + - rscadd: "Added two new donksoft guns, the syndicate's own brand of Foam Force." + - tweak: "New crossbow can be won as an arcade prize." + - tweak: "All kinds of ammo containers can now be used to rapidly collect live ammunition on the ground." + - tweak: "Speedloaders and traditional ammo boxes can now be restocked." + - bugfix: "Security bots now react to being shot." \ No newline at end of file diff --git a/icons/obj/guns/toy.dmi b/icons/obj/guns/toy.dmi index 2f418c7b9a1fe1e6021e1e3789d05ecae277ab39..e3700ae841a0966c8e4591a88757c8c54c8a2968 100644 GIT binary patch delta 2303 zcmVs+MLs?`Gczb6A~!KHab{*TE-o`OGgeksJUl#QWo1|n4qIDWP*6}tMn*3$FMud0 zPE=TcfPnJy05mf;CM78v85>SbQEqK-UR_{8Kt#o;QRvi9rjABXdtyXtR9uX3H%>t% zBq#sOGynfHW)c$rnKK+Q8fRx`06qXSCXW&rdj=k91Hiz*0RI60{{RAq@$3Kq00DGT zPE!Ct=GbNc009t@;1qw=v2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