Skip to content

Commit

Permalink
sigh
Browse files Browse the repository at this point in the history
  • Loading branch information
silicons committed Dec 31, 2024
1 parent 575bff9 commit 6d355d6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 33 deletions.
13 changes: 10 additions & 3 deletions code/game/click/mobs-melee_attack_chain.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
*/
#warn audit calls

Check warning on line 19 in code/game/click/mobs-melee_attack_chain.dm

View workflow job for this annotation

GitHub Actions / Run Linters

#warn audit calls
/mob/proc/melee_attack_chain(datum/event_args/actor/clickchain/clickchain, clickchain_flags)


if(clickchain_flags & CLICKCHAIN_DO_NOT_ATTACK)
return clickchain_flags
#warn deal with this trainwreck

Check warning on line 23 in code/game/click/mobs-melee_attack_chain.dm

View workflow job for this annotation

GitHub Actions / Run Linters

#warn deal with this trainwreck

/**
Expand All @@ -34,6 +34,12 @@
clickchain = default_clickchain_event_args(clickchain)
//! End

//! Legacy
break_cloak()
if(isnull(style))
style = unarmed_attack_style()
//! End

/**
* the tl;dr of how the chain of negotiations go here is;
*
Expand All @@ -42,9 +48,10 @@
* 3. we react to what they return
*/


// -- resolve our side --

sort_of_legacy_imprint_upon_melee_clickchain(clickchain)

// -- call on them --
. = clickchain.target.unarmed_melee_act(src, style, target_zone, clickchain)
var/missed = . & CLICKCHAIN_ATTACK_MISSED
Expand Down
34 changes: 4 additions & 30 deletions code/game/click/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,10 @@
var/stupid_fucking_shim = list2params(params)
RangedAttack(target, stupid_fucking_shim)

/**
* called to try to hit something in melee
*/
/mob/proc/melee_attack_chain(atom/target, datum/event_args/actor/clickchain/clickchain, datum/melee_attack/unarmed/style = unarmed_attack_style(), clickchain_flags, target_zone, mult = 1)
if(isnull(style))
// we can't autoattack
return NONE
if(isnull(clickchain))
clickchain = new(src, target = target, intent = a_intent)
// too complciated to be put in proc header
if(isnull(target_zone))
target_zone = clickchain.performer.zone_sel?.selecting
// end
if(clickchain_flags & CLICKCHAIN_DO_NOT_ATTACK)
return NONE
// todo: not hardcoding this
if(IS_PRONE(clickchain.performer))
mult *= 0.66
// todo: signals
. = melee_attack(target, clickchain, style, clickchain_flags, target_zone, mult)
if(. & CLICKCHAIN_DO_NOT_PROPAGATE)
return
return . | melee_attack_finalize(target, clickchain, style, clickchain_flags, target_zone, mult)
// i'm sorry
/mob/proc/sort_of_legacy_imprint_upon_melee_clickchain(datum/event_args/actor/clickchain/clickchain)
if(IS_PRONE(src))
clickchain.melee_damage_multiplier *= (2 / 3)

/**
* default current unarmed attack style
Expand All @@ -74,16 +55,9 @@
if(!(casted.obj_flags & OBJ_MELEE_TARGETABLE))
// no targeting
return NONE
//? legacy: for now no attacking nonliving
if(ismob(target) && !isliving(target))
return NONE
//? legacy: decloak
clickchain.performer.break_cloak()

// todo: clickcd rework
clickchain.performer.setClickCooldownLegacy(clickchain.performer.get_attack_speed_legacy())
// todo: animation might need to depend on if it hits
// animate_swing_at_target(target)

. = melee_attack_hit(target, clickchain, style, clickchain_flags, target_zone, mult)

Expand Down

0 comments on commit 6d355d6

Please sign in to comment.