This commit is contained in:
silicons
2020-07-18 19:44:12 -07:00
parent b1ccccb322
commit 910869d6bf
13 changed files with 41 additions and 57 deletions
+5 -8
View File
@@ -33,7 +33,7 @@
* item/afterattack(atom,user,adjacent,params) - used both ranged and adjacent
* mob/RangedAttack(atom,params) - used only ranged, only used for tk and laser eyes but could be changed
*/
/mob/proc/ClickOn( atom/A, params )
/mob/proc/ClickOn( atom/A, params)
if(check_click_intercept(params,A))
return
@@ -83,7 +83,7 @@
return M.click_action(A,src,params)
if(restrained())
changeNext_move(CLICK_CD_HANDCUFFED) //Doing shit in cuffs shall be vey slow
DelayNextAction(CLICK_CD_HANDCUFFED)
RestrainedClickOn(A)
return
@@ -104,9 +104,7 @@
if(W)
W.melee_attack_chain(src, A, params)
else
if(ismob(A) && !CheckActionCooldown(CLICK_CD_MELEE))
return
DelayNextAction()
DelayNextAction(ismob(A)? 8 : 0)
UnarmedAttack(A)
return
@@ -119,9 +117,8 @@
if(W)
W.melee_attack_chain(src, A, params)
else
if(ismob(A) && !CheckActionCooldown(CLICK_CD_MELEE))
return
DelayNextAction()
DelayNextAction(ismob(A)? 8 : 0)
DelayNextAction(ismob(A)? 8 : 0)
UnarmedAttack(A, 1)
else
if(W)
-3
View File
@@ -56,9 +56,6 @@
if(id && usr.client) //try to (un)remember position
usr.client.prefs.action_buttons_screen_locs["[name]_[id]"] = locked ? moved : null
return TRUE
if(usr.next_click > world.time)
return
usr.next_click = world.time + 1
linked_action.Trigger()
return TRUE
+1 -11
View File
@@ -47,17 +47,7 @@
name = "swap hand"
/obj/screen/swap_hand/Click()
// At this point in client Click() code we have passed the 1/10 sec check and little else
// We don't even know if it's a middle click
if(world.time <= usr.next_move)
return 1
if(usr.incapacitated())
return 1
if(ismob(usr))
var/mob/M = usr
M.swap_hand()
usr.swap_hand()
return 1
/obj/screen/craft
+3 -6
View File
@@ -21,7 +21,6 @@
return
if(QDELETED(src) || QDELETED(target))
return
PostattackClickdelaySet(user, target)
afterattack(target, user, TRUE, params)
/// Like melee_attack_chain but for ranged.
@@ -81,6 +80,7 @@
user.do_attack_animation(M)
M.attacked_by(src, user, attackchain_flags, damage_multiplier)
PostattackClickdelaySet(user, M)
log_combat(user, M, "attacked", src.name, "(INTENT: [uppertext(user.a_intent)]) (DAMTYPE: [uppertext(damtype)])")
add_fingerprint(user)
@@ -96,8 +96,8 @@
if(item_flags & NOBLUDGEON)
return
user.do_attack_animation(O)
if(!O.attacked_by(src, user))
user.changeNext_move(click_delay)
O.attacked_by(src, user)
PostattackClickdelaySet(user, O)
var/weight = getweight(user, STAM_COST_ATTACK_OBJ_MULT)
if(weight)
user.adjustStaminaLossBuffered(weight)//CIT CHANGE - makes attacking things cause stamina loss
@@ -110,12 +110,9 @@
var/bad_trait
var/stamloss = user.getStaminaLoss()
var/next_move_mult = 1
if(stamloss > STAMINA_NEAR_SOFTCRIT) //The more tired you are, the less damage you do.
var/penalty = (stamloss - STAMINA_NEAR_SOFTCRIT)/(STAMINA_NEAR_CRIT - STAMINA_NEAR_SOFTCRIT)*STAM_CRIT_ITEM_ATTACK_PENALTY
totitemdamage *= 1 - penalty
next_move_mult += penalty*STAM_CRIT_ITEM_ATTACK_DELAY
user.changeNext_move(I.click_delay*next_move_mult)
if(SEND_SIGNAL(user, COMSIG_COMBAT_MODE_CHECK, COMBAT_MODE_INACTIVE))
bad_trait = SKILL_COMBAT_MODE //blacklist combat skills.
+2 -4
View File
@@ -31,8 +31,7 @@
user.dna.add_mutation(XRAY)
user.dna.add_mutation(SPACEMUT)
user.dna.add_mutation(TK)
user.last_action_mult *= 0.5
user.next_action_mult *= 0.5
user.action_cooldown_mod = 0.5
to_chat(user, "Things around you feel slower!")
charges--
insisting = FALSE
@@ -102,8 +101,7 @@
to_chat(user, "[killreward] materializes into your hands!")
else
to_chat(user, "[killreward] materializes onto the floor.")
user.last_action_mult *= 0.8 //20% less delay between attacks!
user.next_action_mult *= 0.8
user.action_cooldown_mod = 0.5
to_chat(user, "Things around you feel slightly slower!")
var/mob/living/simple_animal/hostile/venus_human_trap/killwish = new /mob/living/simple_animal/hostile/venus_human_trap(loc)
killwish.maxHealth = 1500
@@ -4,7 +4,9 @@
var/beamtype = /obj/item/projectile/beam/disabler //change for adminbus
/obj/item/clothing/glasses/hud/security/sunglasses/disablers/ranged_attack(mob/living/carbon/human/user,atom/A, params)
user.changeNext_move(CLICK_CD_RANGE)
if(!user.CheckActionCooldown(CLICK_CD_RANGE))
return
user.last_action = world.time
var/obj/item/projectile/beam/disabler/LE = new beamtype( loc )
playsound(usr.loc, 'sound/weapons/taser2.ogg', 75, 1)
LE.firer = src
@@ -12,4 +14,4 @@
LE.preparePixelProjectile(A, src, params)
LE.fire()
return TRUE
//shamelessly copied
//shamelessly copied
@@ -105,7 +105,7 @@
return
var/mob/living/M = loc
M.changeNext_move(CLICK_CD_RAPID)
M.SetNextAction(CLICK_CD_RAPID)
if(warcry)
M.say("[warcry]", ignore_spam = TRUE, forced = TRUE)
@@ -135,7 +135,7 @@
if(target.stat != CONSCIOUS) //Can't hug people who are dying/dead
return FALSE
else
M.changeNext_move(CLICK_CD_RAPID)
M.SetNextAction(CLICK_CD_RAPID)
return FALSE
+17 -11
View File
@@ -12,14 +12,12 @@
var/last_action = 0
/// Generic clickdelay variable. Next world.time we should be able to do something that respects generic clickdelay. This should be set using [DelayNextAction()] This should only be checked using [CheckActionCooldown()].
var/next_action = 0
/// Simple modification variable added to next action on adjust. This should only be manually modified via addition.
var/next_action_adjust = 0
/// Simple modification variable multiplied to next action modifier on adjust. This should only be manually modified using multipliers.
var/next_action_mult = 1
/// Simple modification variable added to amount when checking time since last action using [CheckActionCooldown()]. This should only be manually modified via addition.
var/last_action_adjust = 0
/// Simple modification variable multiplied to amount when checking time since last action using [CheckActionCooldown()]. This should only be manually modified using multipliers.
var/last_action_mult = 1
/// Simple modification variable multiplied to next action modifier on adjust and on checking time since last action using [CheckActionCooldown()].
/// This should only be manually modified using multipliers.
var/action_cooldown_mod = 0.5
/// Simple modification variable added to amounton adjust and on checking time since last action using [CheckActionCooldown()].
/// This should only be manually modified via addition.
var/action_cooldown_adjust = 0
/// Special clickdelay variable for resisting. Last time we did a special action like resisting. This should be directly set. This should only be checked using [CheckResistCooldown()].
var/last_resist = 0
@@ -37,7 +35,15 @@
/mob/proc/DelayNextAction(amount = 0, ignore_mod = FALSE, considered_action = TRUE)
if(considered_action)
last_action = world.time
next_action = max(next_action, world.time + (ignore_mod? amount : (amount * next_action_mult + next_action_adjust)))
next_action = max(next_action, world.time + (ignore_mod? amount : (amount * action_cooldown_mod + action_cooldown_adjust)))
/**
* Sets our next action to. The difference is DelayNextAction cannot reduce next_action under any circumstances while this can.
*/
/mob/proc/SetNextAction(amount = 0, ignore_mod = FALSE, considered_action = TRUE)
if(considered_action)
last_action = world.time
next_action = world.time + (ignore_mod? amount : (amount * action_cooldown_mod + action_cooldown_adjust))
/**
* Checks if we can do another action.
@@ -50,7 +56,7 @@
* * ignore_next_action - Defaults to FALSE. Ignore next_action and only care about cooldown param and everything else. Generally unused.
*/
/mob/proc/CheckActionCooldown(cooldown = 0.5, from_next_action = FALSE, ignore_mod = FALSE, ignore_next_action = FALSE)
return (ignore_next_action || (world.time >= next_action)) && (world.time >= ((from_next_action? next_action : last_action) + max(0, ignore_mod? cooldown : (cooldown * last_action_mult + last_action_adjust))))
return (ignore_next_action || (world.time >= next_action)) && (world.time >= ((from_next_action? next_action : last_action) + max(0, ignore_mod? cooldown : (cooldown * action_cooldown_mod + action_cooldown_adjust))))
/**
* Checks if we can resist again.
@@ -93,7 +99,7 @@
*/
/obj/item/proc/PreattackClickdelaySet(mob/user, atom/target)
if(clickdelay_set_on_pre_attack)
user.DelayNextAction(0, FALSe, TRUE)
user.DelayNextAction(0, FALSE, TRUE)
/**
* Called after a successful attack to set a mob's clickdelay.
@@ -3,7 +3,7 @@
melee_damage_lower = 20
melee_damage_upper = 20
obj_damage = 80
next_move_modifier = 0.5 //attacks 50% faster
action_cooldown_mod = 0.5 //attacks 50% faster
environment_smash = ENVIRONMENT_SMASH_WALLS
playstyle_string = "<span class='holoparasite'>As a <b>standard</b> type you have no special abilities, but take half damage and have powerful attack capable of smashing through walls.</span>"
magic_fluff_string = "<span class='holoparasite'>..And draw the Assistant, faceless and generic, but never to be underestimated.</span>"
@@ -27,6 +27,8 @@
/obj/item/reagent_containers/spray/afterattack(atom/A, mob/user)
. = ..()
if(!user.CheckActionCooldown(CLICK_CD_MELEE))
return
if(istype(A, /obj/structure/sink) || istype(A, /obj/structure/janitorialcart) || istype(A, /obj/machinery/hydroponics))
return
@@ -50,7 +52,7 @@
spray(A)
playsound(src.loc, 'sound/effects/spray2.ogg', 50, 1, -6)
user.changeNext_move(CLICK_CD_RANGE*2)
user.last_action = world.time
user.newtonian_move(get_dir(A, user))
var/turf/T = get_turf(src)
if(reagents.has_reagent(/datum/reagent/toxin/acid))
-5
View File
@@ -56,11 +56,6 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) //needed for th
to_chat(caller, "<span class='warning'><b>[caller.ranged_ability.name]</b> has been disabled.</span>")
caller.ranged_ability.remove_ranged_ability()
return TRUE //TRUE for failed, FALSE for passed.
if(ranged_clickcd_override >= 0)
ranged_ability_user.next_click = world.time + ranged_clickcd_override
else
ranged_ability_user.next_click = world.time + CLICK_CD_CLICK_ABILITY
ranged_ability_user.face_atom(A)
return FALSE
/obj/effect/proc_holder/proc/add_ranged_ability(mob/living/user, msg, forced)
+1 -1
View File
@@ -279,5 +279,5 @@
H.add_movespeed_modifier(/datum/movespeed_modifier/dna_vault_speedup)
if(VAULT_QUICK)
to_chat(H, "<span class='notice'>Your arms move as fast as lightning.</span>")
H.next_move_modifier = 0.5
H.action_cooldown_mod = 0.5
power_lottery[H] = list()