Skip to content

Commit

Permalink
Rapiers (#4968)
Browse files Browse the repository at this point in the history
* cinq drip

* small fix

* Update code/game/objects/items/weapons/tools/simple_weapons.dm

* Update code/game/objects/items/weapons/tools/simple_weapons.dm

Co-authored-by: benj8560 <[email protected]>

* Update code/game/objects/structures/crates_lockers/closets/secure/medical.dm

Co-authored-by: benj8560 <[email protected]>

* small fix

* new sprites

---------

Co-authored-by: benj8560 <[email protected]>
  • Loading branch information
Trilbyspaceclone and benj8560 authored Jan 29, 2024
1 parent 26712fb commit 9f78d09
Show file tree
Hide file tree
Showing 11 changed files with 154 additions and 21 deletions.
8 changes: 8 additions & 0 deletions code/_onclick/click.dm
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,16 @@
var/gathered = 0
if(ishuman(M))
var/mob/living/carbon/human/back_pack_checker = M
var/obj/item/W = M.get_active_hand()
if(!back_pack_checker.back)
gathered -= 1
if(W)
gathered += W.clickdelay_offset
if(issilicon(M))
var/mob/living/silicon/S = M
var/obj/item/W = S.get_active_hand()
if(W)
gathered += W.clickdelay_offset
gathered += click_delay_addition
return gathered

Expand Down
24 changes: 13 additions & 11 deletions code/_onclick/cyborg.dm
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
if(A == loc || (A in loc) || (A in contents))
// No adjacency checks

var/resolved = A.attackby(W, src, params)
var/resolved = (LEGACY_SEND_SIGNAL(W, COMSIG_IATTACK, A, src, params)) || (LEGACY_SEND_SIGNAL(A, COMSIG_ATTACKBY, W, src, params)) || W.resolve_attackby(A, src, params)
if(!resolved && A && W)
W.afterattack(A, src, 1, params)
return
Expand All @@ -94,14 +94,15 @@
// cyborgs are prohibited from using storage items so we can I think safely remove (A.loc && isturf(A.loc.loc))
if(isturf(A) || isturf(A.loc))
if(A.Adjacent(src)) // see adjacent.dm

var/resolved = A.attackby(W, src)
if(!resolved && A && W)
W.afterattack(A, src, 1, params)
return
else
W.afterattack(A, src, 0, params)
if(W)
// Return 1 in attackby() to prevent afterattack() effects (when safely moving items for example)
var/resolved = (LEGACY_SEND_SIGNAL(W, COMSIG_IATTACK, A, src, params)) || (LEGACY_SEND_SIGNAL(A, COMSIG_ATTACKBY, W, src, params)) || W.resolve_attackby(A, src, params)
if(!resolved && A && W)
W.afterattack(A, src, 1, params) // 1: clicking something Adjacent
return
if(W)
W.afterattack(A, src, 0, params) // 0: not Adjacent

return


Expand Down Expand Up @@ -134,9 +135,10 @@

// cyborgs are prohibited from using storage items so we can I think safely remove (A.loc && isturf(A.loc.loc))
if(isturf(A) || isturf(A.loc))
if(A.Adjacent(src)) // see adjacent.dm
var/resolved = A.attackby(W, src, params)
if (!grippersafety(G))return
if(A.Adjacent(src))
var/resolved = (LEGACY_SEND_SIGNAL(W, COMSIG_IATTACK, A, src, params)) || (LEGACY_SEND_SIGNAL(A, COMSIG_ATTACKBY, W, src, params)) || W.resolve_attackby(A, src, params)
if (!grippersafety(G))
return
if(!resolved && A && W)
W.afterattack(A, src, 1, params)
if (!grippersafety(G))return
Expand Down
5 changes: 1 addition & 4 deletions code/game/objects/items/weapons/tools/hammer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,7 @@
structure_damage_factor = STRUCTURE_DAMAGE_BORING
tool_qualities = list(QUALITY_HAMMERING = 40, QUALITY_PRYING = 1)
matter = list(MATERIAL_STEEL = 30, MATERIAL_PLASTIC = 10, MATERIAL_PLASTEEL = 15)

/obj/item/tool/hammer/ironhammer/attack()
..()
usr.setClickCooldown(DEFAULT_LONG_COOLDOWN)
clickdelay_offset = DEFAULT_LONG_COOLDOWN

/obj/item/tool/hammer/mace
name = "mace"
Expand Down
94 changes: 94 additions & 0 deletions code/game/objects/items/weapons/tools/simple_weapons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,100 @@
armor_penetration = ARMOR_PEN_SHALLOW
price_tag = 325

/obj/item/tool/sword/saber/deconstuctive_rapier
name = "Cinq Deconstructive Rapier"
desc = "A long, thin bladed sword with a weaponized destructive analyzer integrated into the blade. At the moment of its victim's death it is able to deconstruct them and wirelessly transmit data to internal research database."
icon = 'icons/obj/weapons-blades.dmi'
icon_state = "rapier_cro" //Sprite by Gidgit
item_state = "saber"
force = WEAPON_FORCE_PAINFUL - 5 //10 base
armor_penetration = ARMOR_PEN_MODERATE
price_tag = 1600
has_alt_mode = TRUE
attack_verb = list("stabbed", "slashed", "pierces")
alt_mode_damagetype = HALLOSS
alt_mode_sharp = FALSE
alt_mode_verbs = list("jabs", "stunts", "wacks", "blunts")
alt_mode_toggle = "switches their stance to avoid using the blade of their weapon"
alt_mode_lossrate = 1.5 //So its able to be used as a baton in some cases
reagent_flags = INJECTABLE|TRANSPARENT
matter = null //magicium
clickdelay_offset = -4 //DEFAULT_QUICK_COOLDOWN = 4 so we offset are weapon to quick
var/datum/component/rnd_points/point_holder

/obj/item/tool/sword/saber/deconstuctive_rapier/New()
..()
givepointscompont(0)
GET_COMPONENT_FROM(C, /datum/component/rnd_points, src)
point_holder = C

/obj/item/tool/sword/saber/deconstuctive_rapier/proc/add_points(points)
if(point_holder)
//message_admins("[points] points!")
point_holder.data_points += points

/obj/item/tool/sword/saber/deconstuctive_rapier/resolve_attackby(atom/target, mob/user)
.=..()
//Little icky but it works
if(isliving(target))
var/mob/M = target
if(!ishuman(M))
if(!issilicon(M))
if(is_dead(M))
user.visible_message("[user] drives [src.name] into [M.name]'s body, deconstructing it!", "You drive the [src.name] into [M.name], extracting research data")
msg_admin_attack("[user] deconned [M.name] - ([user.ckey]) with \a [src] (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[M.x];Y=[M.y];Z=[M.z]'>JMP</a>)")
M.dust()
add_points(50)
add_overlay(image('icons/obj/cwj_cooking/scan.dmi', icon_state="scan_person", layer=ABOVE_WINDOW_LAYER))
addtimer(CALLBACK(src, /atom.proc/update_icon), 11)
return

/obj/item/tool/sword/saber/injection_rapier
name = "Cinq Inject Rapier"
desc = "A long, thin bladed sword with a hollow chamber in the blade. A mechanical release mechanism allows the wielder to inject targets with fluid from a reservoir in the grip."
icon = 'icons/obj/weapons-blades.dmi' //Sprite by Gidgit
icon_state = "rapier_cbo"
item_state = "saber"
force = WEAPON_FORCE_PAINFUL - 5 //10 base
armor_penetration = ARMOR_PEN_MODERATE
price_tag = 1600
has_alt_mode = TRUE
attack_verb = list("stabbed", "slashed", "pierces")
alt_mode_damagetype = HALLOSS
alt_mode_sharp = FALSE
alt_mode_verbs = list("jabs", "stunts", "wacks", "blunts")
alt_mode_toggle = "switches their stance to avoid using the blade of their weapon"
alt_mode_lossrate = 1.5 //So its able to be used as a baton in some cases
reagent_flags = INJECTABLE|TRANSPARENT
matter = null //magicium
clickdelay_offset = -4 //DEFAULT_QUICK_COOLDOWN = 4 so we offset are weapon to quick

/obj/item/tool/sword/saber/injection_rapier/New()
..()
create_reagents(30)

/obj/item/tool/sword/saber/injection_rapier/resolve_attackby(atom/target, mob/user)
.=..()
if(!target.reagents || !isliving(target))
return

if(!reagents.total_volume)
return

if(!target.reagents.get_free_space())
return
var/modifier = 1
var/reagent_modifier = 1
if(ishuman(user))
var/mob/living/carbon/human/H = user
modifier += min(30,H.stats.getStat(STAT_ROB))
reagent_modifier = CLAMP(round(H.stats.getStat(STAT_BIO)/10), 1, 5)
var/mob/living/L = target
if(prob(min(100,((100+armor_penetration)-L.getarmor(user.targeted_organ, ARMOR_MELEE))+modifier)))
var/trans = reagents.trans_to_mob(target, rand(1,3)*reagent_modifier, CHEM_BLOOD)
admin_inject_log(user, target, src, reagents.log_list(), trans)
to_chat(user, SPAN_NOTICE("You inject [trans] units of the solution. [src] now contains [src.reagents.total_volume] units."))

/obj/item/tool/sword/handmade
name = "junkblade"
desc = "Hack and slash!"
Expand Down
7 changes: 1 addition & 6 deletions code/game/objects/items/weapons/tools/stunbatons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,7 @@
cell = /obj/item/cell/large/high
structure_damage_factor = STRUCTURE_DAMAGE_BLUNT
matter = list(MATERIAL_STEEL = 20, MATERIAL_PLASTEEL = 15, MATERIAL_SILVER = 10)

/obj/item/tool/baton/maul/attack()
..()
usr.setClickCooldown(DEFAULT_ATTACK_COOLDOWN*1.5)


clickdelay_offset = DEFAULT_ATTACK_COOLDOWN*1.5

/obj/item/tool/baton/mini
name = "mini stun baton"
Expand Down
2 changes: 2 additions & 0 deletions code/game/objects/objs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
var/armor_penetration = 0
var/corporation = null
var/heat = 0
//soj edit
var/clickdelay_offset = 0

/obj/proc/is_hot()
return heat
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@
new /obj/item/circuitboard/sleeper/hyper(src)
new /obj/item/oddity/chem_book(src)
new /obj/item/storage/hcases/med(src)
new /obj/item/tool/sword/saber/injection_rapier(src)

/obj/structure/closet/secure_closet/animal
name = "animal control closet"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,4 @@
new /obj/item/circuitboard/teleporter(src)
new /obj/item/circuitboard/aicore(src)
new /obj/item/rig/hazmat/equipped(src)
new /obj/item/tool/sword/saber/deconstuctive_rapier(src)
2 changes: 2 additions & 0 deletions code/modules/mob/living/silicon/robot/robot_modules.dm
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ var/global/list/robot_modules = list(
src.modules += new /obj/item/pen/robopen(src)
src.modules += new /obj/item/form_printer(src)
src.modules += new /obj/item/gripper/paperwork(src)
src.modules += new /obj/item/tool/sword/saber/injection_rapier(src)
src.modules += new /obj/item/device/gps(src)
src.modules += new /obj/item/gripper/ammo(src)
src.modules += new /obj/item/gun/energy/borg/pistol(src)
Expand Down Expand Up @@ -1189,6 +1190,7 @@ var/global/list/robot_modules = list(
src.modules += new /obj/item/form_printer(src)
src.modules += new /obj/item/gripper/paperwork(src)
src.modules += new /obj/item/storage/part_replacer(src)
src.modules += new /obj/item/tool/sword/saber/deconstuctive_rapier(src)
src.modules += new /obj/item/gripper/upgrade(src)
src.modules += new /obj/item/gripper/ammo(src)
src.modules += new /obj/item/gun/energy/borg/pistol(src)
Expand Down
31 changes: 31 additions & 0 deletions code/modules/research/experiment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ GLOBAL_LIST_EMPTY(explosion_watcher_list)
/datum/experiment_data/proc/read_science_tool(obj/item/device/science_tool/I)
var/points = 0

points += I.raw_data_points
I.raw_data_points = 0

for(var/weapon in I.scanned_autopsy_weapons)
if(!(weapon in saved_autopsy_weapons))
saved_autopsy_weapons += weapon
Expand Down Expand Up @@ -348,6 +351,8 @@ GLOBAL_LIST_EMPTY(explosion_watcher_list)
var/list/scanned_fruittraits = list()
//Datablock Data
var/datablocks = 0
//Flat out RnD points 1:1 to give
var/raw_data_points = 0

/obj/item/device/science_tool/Initialize()
. = ..()
Expand Down Expand Up @@ -556,3 +561,29 @@ GLOBAL_LIST_EMPTY(explosion_watcher_list)
/obj/item/computer_hardware/hard_drive/portable/research_points/rare
min_points = 10000
max_points = 20000

/obj/proc/givepointscompont(raw_data_points)

var/datum/component/rnd_points/I = AddComponent(/datum/component/rnd_points)
I.data_points = raw_data_points
I.holding_obj = src

/datum/component/rnd_points
dupe_mode = COMPONENT_DUPE_UNIQUE
can_transfer = TRUE
var/data_points = 0
var/obj/holding_obj //we ASSUME that are holder is an object, after all what else would be able to *PHYSICALY* hold points????

/datum/component/rnd_points/RegisterWithParent()
RegisterSignal(parent, COMSIG_ATTACKBY, .proc/attempt_transfer)

/datum/component/rnd_points/proc/attempt_transfer(obj/I, var/mob/living/user, params)
if(!holding_obj)
return

if(istype(I, /obj/item/device/science_tool)) //HAVE to be at the wire stage, to you know, data jack into wires
var/obj/item/device/science_tool/ST = I
ST.raw_data_points += data_points
user.visible_message("[user] attaches [I]'s datajack to [holding_obj.name].", "You attach [I]'s datajack to [holding_obj.name] gathering [data_points] data points")
data_points = 0
return
Binary file modified icons/obj/weapons-blades.dmi
Binary file not shown.

0 comments on commit 9f78d09

Please sign in to comment.