5c174800fb
About The Pull Request
It annoyed me that we have a perfectly good frag grenade item, and a perfectly good shrapnel component, but no crossover episode between the two. This remedies that, and does a lot, lot more.
dreamseeker_2020-03-30_05-01-13.png
dreamseeker_2020-03-30_05-01-26.png
Big points:
Adds new component: pellet_cloud, which can be used by ammo casings, guns, and landmines to spray shrapnel and display aggregate hit messages ("You're hit by 6 buckshot pellets!" vs "You're hit by the buckshot pellet in the X" x6). All gun ammo that shoot multiple pellets now use this component on firing.
Adds stingbangs, premium less-lethal grenades that shoot off lots of stinger pellets, to cargo. Frag grenades are also reworked to have smaller booms, but shoot off lots of shrapnel shards. You can jump on top of these grenades to absorb a portion of the shrapnel to save those around you! There's an achievement for dying this way, called "Look Out, Sir!"
Projectiles can now embed items/shrapnel. Adds .38 DumDum ammo to cargo that does less damage and has negative armor pen, but can embed in people. This is the only ammo that currently embeds.
Bullets can now ricochet off walls, structures, and machinery (harder surfaces are more likely to ricochet). Only standard .38 and Match Grade .38/.357/L6 ammo can ricochet, with Match Grade being much better at ricocheting. You can buy Match Grade .38 from cargo and Match Grade L6 ammo from the nuke uplink, while Match .357 is admin only.
Armor now protects you from harmful embeds, taking the better of the bullet/bomb armor on the affected limb. Armor penetration can modify this of course, and many blunt embeds like stingbangs and DumDum bullets are significantly worse if you have even 1 armor.
Other misc fixes/changes
Refactored the embed element a bunch and fixed it creating new elements for every instance rather than expected bespoke behavior. There are new /obj/item helpers for modifying and adding embedding.
Fixes #49989: Spears can no longer embed in turfs cause their sprite is annoying to me, it's generally harder for most things to embed in turfs
Fixes #49741: New carbon helpers for removing embedded objects
Fixes #46416: Handles embedded objects getting qdel'd or moved while embedded
Renamed the old shrapnel component for RPG loot to MIRV to avoid confusion
Repathed frag grenades from under minibombs to under base grenades, and added explosion vars to base grenades
Why It's Good For The Game
Fixes a bunch of janky design with embeds, adds lots of new avenues for projectile and grenade variety, ricochets and collateral damage are fun!
Changelog
🆑 Ryll/Shaps
add: Adds stingbangs to cargo (and one in the sec vendor premium), premium less-lethal grenades that shoot off a giant swarm of stingball pellets to help incapacitate swarms of people in tight quarters. You can jump on top of a live one to be a hero and absorb a bunch of shrapnel, same with frag grenades. There's even an achievement for dying to a grenade you jumped on!
add: Projectiles can now embed in people! Or at least grenade shrapnel and the new .38 DumDum ammo, now available in cargo, can. DumDum rounds excel against unarmored targets, but are pricey and do poorly against armored targets.
add: Bullets can now ricochet! Or at least, standard .38 and the new .38/L6 Match Grade ammo can. Match Grade ammo is finely tuned to ricochet easier and seek targets off bounces better, and can be purchased from cargo (for the .38) or nuke ops uplink (for the L6), but standard .38 ammo has a chance to ricochet as well.
tweak: Frag grenades now have smaller explosions but shoot off a bunch of devastating shrapnel, excellent for soft targets!
tweak: Shotguns and other multi-pellet guns now print aggregate messages, so you'll get one "You've been hit by 6 buckshot pellets!" rather than 6 "You've been hit by the buckshot pellet in the X!" messages. Bye bye lag!
balance: Armor can now protect against embedding weapons, taking the best of either the bullet or bomb armor for the limb in question away from the embed chance. Some weapons are better at piercing armor than others!
/🆑
267 lines
8.7 KiB
Plaintext
267 lines
8.7 KiB
Plaintext
/* Pens!
|
|
* Contains:
|
|
* Pens
|
|
* Sleepy Pens
|
|
* Parapens
|
|
* Edaggers
|
|
*/
|
|
|
|
|
|
/*
|
|
* Pens
|
|
*/
|
|
/obj/item/pen
|
|
desc = "It's a normal black ink pen."
|
|
name = "pen"
|
|
icon = 'icons/obj/bureaucracy.dmi'
|
|
icon_state = "pen"
|
|
item_state = "pen"
|
|
slot_flags = ITEM_SLOT_BELT | ITEM_SLOT_EARS
|
|
throwforce = 0
|
|
w_class = WEIGHT_CLASS_TINY
|
|
throw_speed = 3
|
|
throw_range = 7
|
|
custom_materials = list(/datum/material/iron=10)
|
|
pressure_resistance = 2
|
|
grind_results = list(/datum/reagent/iron = 2, /datum/reagent/iodine = 1)
|
|
var/colour = "black" //what colour the ink is!
|
|
var/degrees = 0
|
|
var/font = PEN_FONT
|
|
embedding = list()
|
|
|
|
/obj/item/pen/suicide_act(mob/user)
|
|
user.visible_message("<span class='suicide'>[user] is scribbling numbers all over [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to commit sudoku...</span>")
|
|
return(BRUTELOSS)
|
|
|
|
/obj/item/pen/blue
|
|
desc = "It's a normal blue ink pen."
|
|
icon_state = "pen_blue"
|
|
colour = "blue"
|
|
|
|
/obj/item/pen/red
|
|
desc = "It's a normal red ink pen."
|
|
icon_state = "pen_red"
|
|
colour = "red"
|
|
throw_speed = 4 // red ones go faster (in this case, fast enough to embed!)
|
|
|
|
/obj/item/pen/invisible
|
|
desc = "It's an invisible pen marker."
|
|
icon_state = "pen"
|
|
colour = "white"
|
|
|
|
/obj/item/pen/fourcolor
|
|
desc = "It's a fancy four-color ink pen, set to black."
|
|
name = "four-color pen"
|
|
colour = "black"
|
|
|
|
/obj/item/pen/fourcolor/attack_self(mob/living/carbon/user)
|
|
switch(colour)
|
|
if("black")
|
|
colour = "red"
|
|
throw_speed++
|
|
if("red")
|
|
colour = "green"
|
|
throw_speed = initial(throw_speed)
|
|
if("green")
|
|
colour = "blue"
|
|
else
|
|
colour = "black"
|
|
to_chat(user, "<span class='notice'>\The [src] will now write in [colour].</span>")
|
|
desc = "It's a fancy four-color ink pen, set to [colour]."
|
|
|
|
/obj/item/pen/fountain
|
|
name = "fountain pen"
|
|
desc = "It's a common fountain pen, with a faux wood body."
|
|
icon_state = "pen-fountain"
|
|
font = FOUNTAIN_PEN_FONT
|
|
|
|
/obj/item/pen/charcoal
|
|
name = "charcoal stylus"
|
|
desc = "It's just a wooden stick with some compressed ash on the end. At least it can write."
|
|
icon_state = "pen-charcoal"
|
|
colour = "dimgray"
|
|
font = CHARCOAL_FONT
|
|
custom_materials = null
|
|
grind_results = list(/datum/reagent/ash = 5, /datum/reagent/cellulose = 10)
|
|
|
|
/datum/crafting_recipe/charcoal_stylus
|
|
name = "Charcoal Stylus"
|
|
result = /obj/item/pen/charcoal
|
|
reqs = list(/obj/item/stack/sheet/mineral/wood = 1, /datum/reagent/ash = 30)
|
|
time = 30
|
|
category = CAT_PRIMAL
|
|
|
|
/obj/item/pen/fountain/captain
|
|
name = "captain's fountain pen"
|
|
desc = "It's an expensive Oak fountain pen. The nib is quite sharp."
|
|
icon_state = "pen-fountain-o"
|
|
force = 5
|
|
throwforce = 5
|
|
throw_speed = 4
|
|
colour = "crimson"
|
|
custom_materials = list(/datum/material/gold = 750)
|
|
sharpness = IS_SHARP
|
|
resistance_flags = FIRE_PROOF
|
|
unique_reskin = list("Oak" = "pen-fountain-o",
|
|
"Gold" = "pen-fountain-g",
|
|
"Rosewood" = "pen-fountain-r",
|
|
"Black and Silver" = "pen-fountain-b",
|
|
"Command Blue" = "pen-fountain-cb"
|
|
)
|
|
embedding = list("embed_chance" = 75)
|
|
|
|
/obj/item/pen/fountain/captain/Initialize()
|
|
. = ..()
|
|
AddComponent(/datum/component/butchering, 200, 115) //the pen is mightier than the sword
|
|
|
|
/obj/item/pen/fountain/captain/reskin_obj(mob/M)
|
|
..()
|
|
if(current_skin)
|
|
desc = "It's an expensive [current_skin] fountain pen. The nib is quite sharp."
|
|
|
|
/obj/item/pen/attack_self(mob/living/carbon/user)
|
|
var/deg = input(user, "What angle would you like to rotate the pen head to? (1-360)", "Rotate Pen Head") as null|num
|
|
if(deg && (deg > 0 && deg <= 360))
|
|
degrees = deg
|
|
to_chat(user, "<span class='notice'>You rotate the top of the pen to [degrees] degrees.</span>")
|
|
SEND_SIGNAL(src, COMSIG_PEN_ROTATED, deg, user)
|
|
|
|
/obj/item/pen/attack(mob/living/M, mob/user,stealth)
|
|
if(!istype(M))
|
|
return
|
|
|
|
if(!force)
|
|
if(M.can_inject(user, 1))
|
|
to_chat(user, "<span class='warning'>You stab [M] with the pen.</span>")
|
|
if(!stealth)
|
|
to_chat(M, "<span class='danger'>You feel a tiny prick!</span>")
|
|
. = 1
|
|
|
|
log_combat(user, M, "stabbed", src)
|
|
|
|
else
|
|
. = ..()
|
|
|
|
/obj/item/pen/afterattack(obj/O, mob/living/user, proximity)
|
|
. = ..()
|
|
//Changing Name/Description of items. Only works if they have the 'unique_rename' flag set
|
|
if(isobj(O) && proximity && (O.obj_flags & UNIQUE_RENAME))
|
|
var/penchoice = input(user, "What would you like to edit?", "Rename or change description?") as null|anything in list("Rename","Change description")
|
|
if(QDELETED(O) || !user.canUseTopic(O, BE_CLOSE))
|
|
return
|
|
if(penchoice == "Rename")
|
|
var/input = stripped_input(user,"What do you want to name \the [O.name]?", ,"", MAX_NAME_LEN)
|
|
var/oldname = O.name
|
|
if(QDELETED(O) || !user.canUseTopic(O, BE_CLOSE))
|
|
return
|
|
if(oldname == input)
|
|
to_chat(user, "<span class='notice'>You changed \the [O.name] to... well... \the [O.name].</span>")
|
|
else
|
|
O.name = input
|
|
to_chat(user, "<span class='notice'>\The [oldname] has been successfully been renamed to \the [input].</span>")
|
|
O.renamedByPlayer = TRUE
|
|
|
|
if(penchoice == "Change description")
|
|
var/input = stripped_input(user,"Describe \the [O.name] here", ,"", 100)
|
|
if(QDELETED(O) || !user.canUseTopic(O, BE_CLOSE))
|
|
return
|
|
O.desc = input
|
|
to_chat(user, "<span class='notice'>You have successfully changed \the [O.name]'s description.</span>")
|
|
|
|
/*
|
|
* Sleepypens
|
|
*/
|
|
|
|
/obj/item/pen/sleepy/attack(mob/living/M, mob/user)
|
|
if(!istype(M))
|
|
return
|
|
|
|
if(..())
|
|
if(reagents.total_volume)
|
|
if(M.reagents)
|
|
reagents.reaction(M, INJECT, reagents.total_volume)
|
|
reagents.trans_to(M, reagents.total_volume, transfered_by = user)
|
|
|
|
|
|
/obj/item/pen/sleepy/Initialize()
|
|
. = ..()
|
|
create_reagents(45, OPENCONTAINER)
|
|
reagents.add_reagent(/datum/reagent/toxin/chloralhydrate, 20)
|
|
reagents.add_reagent(/datum/reagent/toxin/mutetoxin, 15)
|
|
reagents.add_reagent(/datum/reagent/toxin/staminatoxin, 10)
|
|
|
|
/*
|
|
* (Alan) Edaggers
|
|
*/
|
|
/obj/item/pen/edagger
|
|
attack_verb = list("slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") //these wont show up if the pen is off
|
|
sharpness = IS_SHARP
|
|
var/on = FALSE
|
|
|
|
/obj/item/pen/edagger/ComponentInitialize()
|
|
. = ..()
|
|
AddComponent(/datum/component/butchering, 60, 100, 0, 'sound/weapons/blade1.ogg')
|
|
AddElement(/datum/element/update_icon_updates_onmob)
|
|
|
|
/obj/item/pen/edagger/get_sharpness()
|
|
return on * sharpness
|
|
|
|
/obj/item/pen/edagger/suicide_act(mob/user)
|
|
. = BRUTELOSS
|
|
if(on)
|
|
user.visible_message("<span class='suicide'>[user] forcefully rams the pen into their mouth!</span>")
|
|
else
|
|
user.visible_message("<span class='suicide'>[user] is holding a pen up to their mouth! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
|
attack_self(user)
|
|
|
|
/obj/item/pen/edagger/attack_self(mob/living/user)
|
|
if(on)
|
|
on = FALSE
|
|
force = initial(force)
|
|
throw_speed = initial(throw_speed)
|
|
w_class = initial(w_class)
|
|
name = initial(name)
|
|
hitsound = initial(hitsound)
|
|
embedding = list(embed_chance = EMBED_CHANCE)
|
|
throwforce = initial(throwforce)
|
|
playsound(user, 'sound/weapons/saberoff.ogg', 5, TRUE)
|
|
to_chat(user, "<span class='warning'>[src] can now be concealed.</span>")
|
|
else
|
|
on = TRUE
|
|
force = 18
|
|
throw_speed = 4
|
|
w_class = WEIGHT_CLASS_NORMAL
|
|
name = "energy dagger"
|
|
hitsound = 'sound/weapons/blade1.ogg'
|
|
embedding = list(embed_chance = 100) //rule of cool
|
|
throwforce = 35
|
|
playsound(user, 'sound/weapons/saberon.ogg', 5, TRUE)
|
|
to_chat(user, "<span class='warning'>[src] is now active.</span>")
|
|
updateEmbedding()
|
|
update_icon()
|
|
|
|
/obj/item/pen/edagger/update_icon_state()
|
|
if(on)
|
|
icon_state = item_state = "edagger"
|
|
lefthand_file = 'icons/mob/inhands/weapons/swords_lefthand.dmi'
|
|
righthand_file = 'icons/mob/inhands/weapons/swords_righthand.dmi'
|
|
else
|
|
icon_state = initial(icon_state) //looks like a normal pen when off.
|
|
item_state = initial(item_state)
|
|
lefthand_file = initial(lefthand_file)
|
|
righthand_file = initial(righthand_file)
|
|
|
|
/obj/item/pen/survival
|
|
name = "survival pen"
|
|
desc = "The latest in portable survival technology, this pen was designed as a miniature diamond pickaxe. Watchers find them very desirable for their diamond exterior."
|
|
icon = 'icons/obj/bureaucracy.dmi'
|
|
icon_state = "digging_pen"
|
|
item_state = "pen"
|
|
force = 3
|
|
w_class = WEIGHT_CLASS_TINY
|
|
custom_materials = list(/datum/material/iron=10, /datum/material/diamond=100, /datum/material/titanium = 10)
|
|
pressure_resistance = 2
|
|
grind_results = list(/datum/reagent/iron = 2, /datum/reagent/iodine = 1)
|
|
tool_behaviour = TOOL_MINING //For the classic "digging out of prison with a spoon but you're in space so this analogy doesn't work" situation.
|
|
toolspeed = 10 //You will never willingly choose to use one of these over a shovel.
|