Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implements active parrying as a mechanic #556

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions maplestation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -6062,6 +6062,7 @@
#include "maplestation_modules\code\__DEFINES\antag_defines.dm"
#include "maplestation_modules\code\__DEFINES\captain_weapons.dm"
#include "maplestation_modules\code\__DEFINES\colors.dm"
#include "maplestation_modules\code\__DEFINES\combat.dm"
#include "maplestation_modules\code\__DEFINES\DNA.dm"
#include "maplestation_modules\code\__DEFINES\examine_defines.dm"
#include "maplestation_modules\code\__DEFINES\is_helpers.dm"
Expand All @@ -6086,8 +6087,10 @@
#include "maplestation_modules\code\controllers\configuration\entries\autotransfer.dm"
#include "maplestation_modules\code\controllers\subsystem\autotransfer.dm"
#include "maplestation_modules\code\controllers\subsystem\economy.dm"
#include "maplestation_modules\code\controllers\subsystem\mouse_entered.dm"
#include "maplestation_modules\code\controllers\subsystem\pain_subsystem.dm"
#include "maplestation_modules\code\datums\shuttles.dm"
#include "maplestation_modules\code\datums\components\active_combat.dm"
#include "maplestation_modules\code\datums\components\easy_ignite.dm"
#include "maplestation_modules\code\datums\components\knockoff_move.dm"
#include "maplestation_modules\code\datums\components\limbless_aid.dm"
Expand Down Expand Up @@ -6149,6 +6152,7 @@
#include "maplestation_modules\code\game\objects\items\cards_ids.dm"
#include "maplestation_modules\code\game\objects\items\holy_weapons.dm"
#include "maplestation_modules\code\game\objects\items\locker_spawners.dm"
#include "maplestation_modules\code\game\objects\items\parry_info.dm"
#include "maplestation_modules\code\game\objects\items\plushes.dm"
#include "maplestation_modules\code\game\objects\items\toys.dm"
#include "maplestation_modules\code\game\objects\items\weaponry.dm"
Expand Down
40 changes: 40 additions & 0 deletions maplestation_modules/code/__DEFINES/combat.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Directional behaviors

/// Can block/parry attacks from any direction
#define ACTIVE_COMBAT_OMNIDIRECTIONAL 0
/// Can block/parry attacks from the direction you're facing + diagonals. Default behavior
#define ACTIVE_COMBAT_FACING 1
/// Only can block/parry attacks from the directions you're facing - cardinals only
#define ACTIVE_COMBAT_CARDINAL_FACING 2

// Effects for successfull blocks
// Also used on self upon failing to parry/block
/// Click on the attacker upon blocking for a parry, list assoc should be TRUE or a damage multiplier
#define ACTIVE_COMBAT_PARRY "active_combat_parry"
/// Shoves the attacker, list assoc should be TRUE
#define ACTIVE_COMBAT_SHOVE "active_combat_shove"
/// Evades to the side, if sides are occupied evades back, list assoc should be TRUE or maximum distance for the evade
#define ACTIVE_COMBAT_EVADE "active_combat_evade"
/// Knocks the attacker down, list assoc is duration. Can be used in failed parries
#define ACTIVE_COMBAT_KNOCKDOWN "active_combat_knockdown"
/// Staggers the attacker, list assoc is duration. Can be used in failed parries
#define ACTIVE_COMBAT_STAGGER "active_combat_stagger"
/// Deals stamina to the attacker, list assoc is amount. Can be used in failed parries
#define ACTIVE_COMBAT_STAMINA "active_combat_stamina"
/// Make an emote, list assoc is emote itself. Can be used in failed parries
#define ACTIVE_COMBAT_EMOTE "active_combat_emote"
/// Reflect a projectile if hit by one at whatever the user is currently hovering their mouse over, list assoc is TRUE
#define ACTIVE_COMBAT_REFLECT_PROJECTILE "active_combat_reflect_projectile"
/// Makes the damage go through even if the parry was good enough, list assoc is TRUE
#define ACTIVE_COMBAT_FORCED_DAMAGE "active_combat_forced_damage"

// Parry states
#define ACTIVE_COMBAT_INACTIVE 0
#define ACTIVE_COMBAT_PREPARED 1
#define ACTIVE_COMBAT_RECOVERING 2

// Parry returns
#define PARRY_FAILURE NONE
#define PARRY_SUCCESS (1<<0)
#define PARRY_FULL_BLOCK (1<<1)
#define PARRY_RETALIATE (1<<2)
3 changes: 3 additions & 0 deletions maplestation_modules/code/__DEFINES/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@

/// A carbon drank some caffeine. (signal, caffeine_content)
#define COMSIG_CARBON_DRINK_CAFFEINE "carbon_drink_caffeine"

/// A living mob pressed the active block button
#define COMSIG_LIVING_ACTIVE_BLOCK_KEYBIND "living_active_block_keybind"
10 changes: 10 additions & 0 deletions maplestation_modules/code/controllers/subsystem/mouse_entered.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/datum/controller/subsystem/mouse_entered
var/list/sustained_hovers = list()

/atom/MouseEntered(location, control, params)
. = ..()
SSmouse_entered.sustained_hovers[usr.client] = src

/atom/MouseExited(location, control, params)
. = ..()
SSmouse_entered.sustained_hovers[usr.client] = null
Loading
Loading