mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 23:27:34 +01:00
Cleans up + Improves bows, Sorts files, Adds the Divine Archer clothing, weapon, rite (#74811)
## About The Pull Request ### Divine Archer 🏹  Adds a new chaplain weapon and suit of armor, the divine archer. It's an orderable set of armor, but provides less armor than the rest, but you get more pieces of armor (boots, bracer, undersuit). The divine bow comes with a quiver that holds holy arrows. The holy arrows come with bane support, dealing critical damage to revenants. ### Bow Features ⭐ - arrows can now be dipped in poison ### Bow Improvements 🔧 - bows now drop their arrow when you put them on your back while nocking a bow - bows give feedback for trying to draw without a nocked arrow - codewise, bows support subtypes much better. They still have hard-sprited loaded arrows, but one day that'll change. ## Why It's Good For The Game Yeah, we could add null rod #2342 that does almost the same as the others, or we could have a unique bow weapon! Player Dev Project thread: https://discord.com/channels/326822144233439242/1093521091957370940/1093521091957370940 ## Changelog 🆑 tralezab code, Drag for the commission and player project, cre#0484 for their spritework add: Divine Archer Armor and Weapon qol: Bows give more feedback when you're doing something wrong, like trying to draw without a nocked arrow code: Sorted files, cleaned bow code up to allow subtypes /🆑
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
/**
|
||||
* ## On Hit Effect Component!
|
||||
*
|
||||
* Component for other elements/components to rely on for on-hit effects without duplicating the on-hit code.
|
||||
* See Lifesteal, or bane for examples.
|
||||
*
|
||||
* THIS COULD EASILY SUPPORT COMPONENT_DUPE_ALLOWED but the getcomponent makes it throw errors. if you can figure that out feel free to readd the dupe types
|
||||
*/
|
||||
/datum/component/on_hit_effect
|
||||
///callback used by other components to apply effects
|
||||
var/datum/callback/on_hit_callback
|
||||
///callback optionally used for more checks
|
||||
var/datum/callback/extra_check_callback
|
||||
|
||||
/datum/component/on_hit_effect/Initialize(on_hit_callback, extra_check_callback)
|
||||
src.on_hit_callback = on_hit_callback
|
||||
src.extra_check_callback = extra_check_callback
|
||||
if(!(ismachinery(parent) || isstructure(parent) || isgun(parent) || isprojectilespell(parent) || isitem(parent) || isanimal_or_basicmob(parent) || isprojectile(parent)))
|
||||
return ELEMENT_INCOMPATIBLE
|
||||
|
||||
/datum/component/on_hit_effect/RegisterWithParent()
|
||||
if(ismachinery(parent) || isstructure(parent) || isgun(parent) || isprojectilespell(parent))
|
||||
RegisterSignal(parent, COMSIG_PROJECTILE_ON_HIT, PROC_REF(on_projectile_hit))
|
||||
else if(isitem(parent))
|
||||
RegisterSignal(parent, COMSIG_ITEM_AFTERATTACK, PROC_REF(item_afterattack))
|
||||
else if(isanimal_or_basicmob(parent))
|
||||
RegisterSignal(parent, COMSIG_HOSTILE_POST_ATTACKINGTARGET, PROC_REF(hostile_attackingtarget))
|
||||
else if(isprojectile(parent))
|
||||
RegisterSignal(parent, COMSIG_PROJECTILE_SELF_ON_HIT, PROC_REF(on_projectile_self_hit))
|
||||
|
||||
/datum/component/on_hit_effect/UnregisterFromParent()
|
||||
UnregisterSignal(parent, list(
|
||||
COMSIG_PROJECTILE_ON_HIT,
|
||||
COMSIG_ITEM_AFTERATTACK,
|
||||
COMSIG_HOSTILE_POST_ATTACKINGTARGET,
|
||||
COMSIG_PROJECTILE_SELF_ON_HIT,
|
||||
))
|
||||
|
||||
/datum/component/on_hit_effect/proc/item_afterattack(obj/item/source, atom/target, mob/user, proximity_flag, click_parameters)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
if(!proximity_flag)
|
||||
return
|
||||
|
||||
if(extra_check_callback)
|
||||
if(!extra_check_callback.Invoke(user, target))
|
||||
return
|
||||
on_hit_callback.Invoke(source, user, target, user.zone_selected)
|
||||
return COMPONENT_AFTERATTACK_PROCESSED_ITEM
|
||||
|
||||
/datum/component/on_hit_effect/proc/hostile_attackingtarget(mob/living/attacker, atom/target, success)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
if(!success)
|
||||
return
|
||||
|
||||
if(extra_check_callback)
|
||||
if(!extra_check_callback.Invoke(attacker, target))
|
||||
return
|
||||
on_hit_callback.Invoke(attacker, attacker, target, attacker.zone_selected)
|
||||
|
||||
/datum/component/on_hit_effect/proc/on_projectile_hit(datum/fired_from, atom/movable/firer, atom/target, angle, obj/item/bodypart/hit_limb)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
if(extra_check_callback)
|
||||
if(!extra_check_callback.Invoke(firer, target))
|
||||
return
|
||||
on_hit_callback.Invoke(fired_from, firer, target, hit_limb.body_zone)
|
||||
|
||||
/datum/component/on_hit_effect/proc/on_projectile_self_hit(datum/source, mob/firer, atom/target, angle, obj/item/bodypart/hit_limb)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
if(extra_check_callback)
|
||||
if(!extra_check_callback.Invoke(firer, target))
|
||||
return
|
||||
on_hit_callback.Invoke(source, firer, target, hit_limb.body_zone)
|
||||
@@ -120,7 +120,7 @@
|
||||
message_admins("[ADMIN_LOOKUPFLW(usr)] has tried to spawn an item when selecting a sect.")
|
||||
return
|
||||
if(user.mind.holy_role != HOLY_ROLE_HIGHPRIEST)
|
||||
to_chat(user, "<span class='warning'>You are not the high priest, and therefore cannot select a religious sect.")
|
||||
to_chat(user, span_warning("You are not the high priest, and therefore cannot select a religious sect."))
|
||||
return
|
||||
if(!user.can_perform_action(parent, FORBID_TELEKINESIS_REACH))
|
||||
to_chat(user,span_warning("You cannot select a sect at this time."))
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* sect nullrod bonus component; for sekret rite combos
|
||||
*
|
||||
* Good example is the bow and pyre sect. pick the bow, get a special rite in the pyre sect.
|
||||
*/
|
||||
/datum/component/sect_nullrod_bonus
|
||||
/// assoc list of nullrod type -> rites it unlocks
|
||||
var/list/bonus_rites
|
||||
/// has this component given the bonus yet
|
||||
var/bonus_applied = FALSE
|
||||
|
||||
/datum/component/sect_nullrod_bonus/Initialize(list/bonus_rites)
|
||||
if(!istype(parent, /datum/religion_sect))
|
||||
return COMPONENT_INCOMPATIBLE
|
||||
src.bonus_rites = bonus_rites
|
||||
check_bonus_rites()
|
||||
|
||||
/datum/component/sect_nullrod_bonus/RegisterWithParent()
|
||||
RegisterSignal(SSdcs, COMSIG_GLOB_NULLROD_PICKED, PROC_REF(on_nullrod_picked))
|
||||
|
||||
/datum/component/sect_nullrod_bonus/UnregisterFromParent()
|
||||
UnregisterSignal(SSdcs, COMSIG_GLOB_NULLROD_PICKED)
|
||||
|
||||
/datum/component/sect_nullrod_bonus/proc/on_nullrod_picked(datum/source)
|
||||
SIGNAL_HANDLER
|
||||
check_bonus_rites()
|
||||
|
||||
/datum/component/sect_nullrod_bonus/proc/check_bonus_rites()
|
||||
if(bonus_applied || !GLOB.holy_weapon_type)
|
||||
return
|
||||
var/list/unlocked_rites = bonus_rites[GLOB.holy_weapon_type]
|
||||
if(!unlocked_rites)
|
||||
return
|
||||
GLOB.religious_sect.rites_list.Add(unlocked_rites)
|
||||
bonus_applied = TRUE
|
||||
Reference in New Issue
Block a user