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

Martial Arts combo meter & fixes #12179

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
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: 1 addition & 3 deletions beestation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,6 @@
#include "code\_onclick\hud\alien_larva.dm"
#include "code\_onclick\hud\blob_overmind.dm"
#include "code\_onclick\hud\blobbernauthud.dm"
#include "code\_onclick\hud\constructs.dm"
#include "code\_onclick\hud\credits.dm"
#include "code\_onclick\hud\drones.dm"
#include "code\_onclick\hud\fullscreen.dm"
Expand All @@ -382,7 +381,7 @@
#include "code\_onclick\hud\holoparasite.dm"
#include "code\_onclick\hud\hud.dm"
#include "code\_onclick\hud\human.dm"
#include "code\_onclick\hud\lavaland_elite.dm"
#include "code\_onclick\hud\living.dm"
#include "code\_onclick\hud\map_popups.dm"
#include "code\_onclick\hud\minebot.dm"
#include "code\_onclick\hud\monkey.dm"
Expand All @@ -396,7 +395,6 @@
#include "code\_onclick\hud\revenanthud.dm"
#include "code\_onclick\hud\robot.dm"
#include "code\_onclick\hud\screen_objects.dm"
#include "code\_onclick\hud\slime.dm"
#include "code\_onclick\hud\swarmer.dm"
#include "code\_onclick\hud\rendering\plane_master.dm"
#include "code\_onclick\hud\rendering\plane_master_controller.dm"
Expand Down
9 changes: 9 additions & 0 deletions code/__DEFINES/combat.dm
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,15 @@ GLOBAL_LIST_INIT(shove_disarming_types, typecacheof(list(

#define NICE_SHOT_RICOCHET_BONUS 10 //if the shooter has the NICE_SHOT trait and they fire a ricocheting projectile, add this to the ricochet chance and auto aim angle

/// Martial arts attack requested but is not available, allow a check for a regular attack.
#define MARTIAL_ATTACK_INVALID -1

/// Martial arts attack happened but failed, do not allow a check for a regular attack.
#define MARTIAL_ATTACK_FAIL FALSE

/// Martial arts attack happened and succeeded, do not allow a check for a regular attack.
#define MARTIAL_ATTACK_SUCCESS TRUE

// Flags for energy shields
/// Energy shields will block projectiles
#define ENERGY_SHIELD_BLOCK_PROJECTILES (1 << 0)
Expand Down
4 changes: 4 additions & 0 deletions code/__DEFINES/traits/declarations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_HUSK "husk"
#define TRAIT_BADDNA "baddna"
#define TRAIT_CLUMSY "clumsy"
//means that you can't use weapons with normal trigger guards.
#define TRAIT_CHUNKYFINGERS "chunkyfingers"
#define TRAIT_DUMB "dumb"
#define TRAIT_DISCOORDINATED "discoordinated" //sets IsAdvancedToolUser to FALSE on humans and monkies
#define TRAIT_PACIFISM "pacifism"
Expand All @@ -68,6 +70,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_RESISTCOLD "resist_cold"
#define TRAIT_RESISTHIGHPRESSURE "resist_high_pressure"
#define TRAIT_RESISTLOWPRESSURE "resist_low_pressure"
#define TRAIT_BOMBIMMUNE "bomb_immunity"
#define TRAIT_RADIMMUNE "rad_immunity"
#define TRAIT_NORADDAMAGE "no_rad_damage"
#define TRAIT_VIRUSIMMUNE "virus_immunity"
Expand Down Expand Up @@ -172,6 +175,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_NO_BLOOD "no_blood" // Bleeding heals itself and bleeding is impossible
#define TRAIT_NO_BLEEDING "no_bleed" // The user can acquire the bleeding status effect, but will no lose blood
#define TRAIT_BLOOD_COOLANT "blood_coolant" // Replaces blood with coolant, meaning we overheat instead of losing air
#define TRAIT_MARTIAL_ARTS_IMMUNE "martial_arts_immune" // nobody can use martial arts on this mob

// You can stare into the abyss, but it does not stare back.
// You're immune to the hallucination effect of the supermatter, either
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/traits/sources.dm
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
#define ANTI_DROP_IMPLANT_TRAIT "anti-drop-implant"
#define HIVEMIND_TRAIT "hivemind-trait"
#define VR_ZONE_TRAIT "vr_zone_trait"
#define SLEEPING_CARP_TRAIT "sleeping_carp"
#define GLUED_ITEM_TRAIT "glued-item"
#define LEGION_CORE_TRAIT "legion_core_trait"
#define MIRROR_TRAIT "mirror_trait"
Expand Down
5 changes: 4 additions & 1 deletion code/_globalvars/traits/_traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_RESISTCOLD" = TRAIT_RESISTCOLD,
"TRAIT_RESISTHIGHPRESSURE" = TRAIT_RESISTHIGHPRESSURE,
"TRAIT_RESISTLOWPRESSURE" = TRAIT_RESISTLOWPRESSURE,
"TRAIT_BOMBIMMUNE" = TRAIT_BOMBIMMUNE,
"TRAIT_RADIMMUNE" = TRAIT_RADIMMUNE,
"TRAIT_VIRUSIMMUNE" = TRAIT_VIRUSIMMUNE,
"TRAIT_PIERCEIMMUNE" = TRAIT_PIERCEIMMUNE,
Expand Down Expand Up @@ -184,7 +185,9 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_IGNORING_GRAVITY" = TRAIT_IGNORING_GRAVITY,
"TRAIT_FORCED_GRAVITY" = TRAIT_FORCED_GRAVITY,
"TRAIT_MOVE_UPSIDE_DOWN" = TRAIT_MOVE_UPSIDE_DOWN,
"TRAIT_NEGATES_GRAVITY" = TRAIT_NEGATES_GRAVITY
"TRAIT_NEGATES_GRAVITY" = TRAIT_NEGATES_GRAVITY,
"TRAIT_MARTIAL_ARTS_IMMUNE" = TRAIT_MARTIAL_ARTS_IMMUNE,
"TRAIT_CHUNKYFINGERS" = TRAIT_CHUNKYFINGERS,
),
/obj/item/integrated_circuit = list(
"TRAIT_COMPONENT_MMI" = TRAIT_COMPONENT_MMI,
Expand Down
35 changes: 27 additions & 8 deletions code/_onclick/click.dm
Original file line number Diff line number Diff line change
Expand Up @@ -337,15 +337,34 @@
if(istype(ML))
ML.pulled(src)

/mob/living/CtrlClick(mob/user)
if(!isliving(user) || !Adjacent(user) || user.incapacitated())
return ..()

if(world.time < user.next_move)
return FALSE

var/mob/living/user_living = user
if(user_living.apply_martial_art(src, null) == MARTIAL_ATTACK_SUCCESS)
user_living.changeNext_move(CLICK_CD_MELEE)
return TRUE

return ..()

/mob/living/carbon/human/CtrlClick(mob/user)
if(ishuman(user) && Adjacent(user) && !user.incapacitated())
if(world.time < user.next_move)
return FALSE
var/mob/living/carbon/human/H = user
H.dna.species.grab(H, src, H.mind.martial_art)
H.changeNext_move(CLICK_CD_MELEE)
else
..()

if(!ishuman(user) ||!Adjacent(user) || user.incapacitated())
return ..()

if(world.time < user.next_move)
return FALSE

var/mob/living/carbon/human/human_user = user
if(human_user.dna.species.grab(human_user, src, human_user.mind.martial_art))
human_user.changeNext_move(CLICK_CD_MELEE)
return TRUE

return ..()

/mob/proc/CtrlMiddleClickOn(atom/A)
// specifically made for admin feature.
Expand Down
40 changes: 20 additions & 20 deletions code/_onclick/hud/_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,6 @@
Therefore, the top right corner (except during admin shenanigans) is at "17,15"
*/

//Lower left, persistent menu
#define ui_inventory "WEST:6,SOUTH:5"

//Middle left indicators
#define ui_lingchemdisplay "WEST,CENTER-1:15"
#define ui_lingstingdisplay "WEST:6,CENTER-3:11"

#define ui_devilsouldisplay "WEST:6,CENTER-1:15"

//Lower center, persistent menu
#define ui_sstore1 "CENTER-5:10,SOUTH:5"
#define ui_id "CENTER-4:12,SOUTH:5"
#define ui_belt "CENTER-3:14,SOUTH:5"
#define ui_back "CENTER-2:14,SOUTH:5"

/proc/ui_hand_position(i) //values based on old hand ui positions (CENTER:-/+16,SOUTH:5)
var/x_off = -(!(i % 2))
var/y_off = round((i-1) / 2)
Expand All @@ -46,8 +31,22 @@
var/y_off = round((M.held_items.len-1) / 2)
return "CENTER+[x_off]:16,SOUTH+[y_off+1]:5"

//Lower left, persistent menu
#define ui_inventory "WEST:6,SOUTH:5"

//Middle left indicators
#define ui_lingchemdisplay "WEST,CENTER-1:15"
#define ui_lingstingdisplay "WEST:6,CENTER-3:11"
#define ui_devilsouldisplay "WEST:6,CENTER-1:15"

//Lower center, persistent menu
#define ui_sstore1 "CENTER-5:10,SOUTH:5"
#define ui_id "CENTER-4:12,SOUTH:5"
#define ui_belt "CENTER-3:14,SOUTH:5"
#define ui_back "CENTER-2:14,SOUTH:5"
#define ui_storage1 "CENTER+1:18,SOUTH:5"
#define ui_storage2 "CENTER+2:20,SOUTH:5"
#define ui_combo "CENTER+4:24,SOUTH+1:7" //combo meter for martial arts

#define ui_borg_lamp "CENTER-3:16, SOUTH:5" //borgs
#define ui_borg_tablet "CENTER-4:16, SOUTH:5" //borgs
Expand All @@ -61,6 +60,10 @@
#define ui_borg_crew_manifest "CENTER+5:21,SOUTH:5" //borgs
#define ui_borg_language_menu "CENTER+4:21,SOUTH+1:5" //borgs

//Generic living
#define ui_living_pull "EAST-1:28,CENTER-3:15"
#define ui_living_healthdoll "EAST-1:28,CENTER-1:15"

#define ui_monkey_body "CENTER-6:12,SOUTH:5" //monkey
#define ui_monkey_head "CENTER-5:14,SOUTH:5" //monkey
#define ui_monkey_mask "CENTER-4:15,SOUTH:5" //monkey
Expand Down Expand Up @@ -117,12 +120,9 @@
#define ui_alienplasmadisplay "EAST,CENTER-2:15"
#define ui_alien_queen_finder "EAST,CENTER-3:15"

//constructs
//Constructs
#define ui_construct_pull "EAST,CENTER-2:15"
#define ui_construct_health "EAST,CENTER:15" //same as borgs and humans

//slimes
#define ui_slime_health "EAST,CENTER:15" //same as borgs, constructs and humans
#define ui_construct_health "EAST,CENTER:15"

// AI

Expand Down
15 changes: 0 additions & 15 deletions code/_onclick/hud/constructs.dm

This file was deleted.

4 changes: 2 additions & 2 deletions code/_onclick/hud/hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
var/atom/movable/screen/alien_plasma_display
var/atom/movable/screen/alien_queen_finder

var/atom/movable/screen/devil/soul_counter/devilsouldisplay
var/atom/movable/screen/combo/combo_display

var/atom/movable/screen/action_intent
var/atom/movable/screen/zone_select
Expand Down Expand Up @@ -117,11 +117,11 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
healthdoll = null
internals = null
lingchemdisplay = null
devilsouldisplay = null
lingstingdisplay = null
blobpwrdisplay = null
alien_plasma_display = null
alien_queen_finder = null
combo_display = null

QDEL_LIST_ASSOC_VAL(plane_masters)
QDEL_LIST_ASSOC_VAL(plane_master_controllers)
Expand Down
7 changes: 3 additions & 4 deletions code/_onclick/hud/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -340,16 +340,15 @@
lingstingdisplay.hud = src
infodisplay += lingstingdisplay

devilsouldisplay = new /atom/movable/screen/devil/soul_counter
devilsouldisplay.hud = src
infodisplay += devilsouldisplay

zone_select = new /atom/movable/screen/zone_sel()
zone_select.icon = ui_style
zone_select.update_icon()
zone_select.hud = src
static_inventory += zone_select

combo_display = new /atom/movable/screen/combo()
infodisplay += combo_display

for(var/atom/movable/screen/inventory/inv in (static_inventory + toggleable_inventory))
if(inv.slot_id)
inv.hud = src
Expand Down
7 changes: 0 additions & 7 deletions code/_onclick/hud/lavaland_elite.dm

This file was deleted.

20 changes: 20 additions & 0 deletions code/_onclick/hud/living.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/datum/hud/living
ui_style = 'icons/hud/screen_gen.dmi'

/datum/hud/living/New(mob/living/owner)
..()

pull_icon = new /atom/movable/screen/pull()
pull_icon.icon = ui_style
pull_icon.update_appearance()
pull_icon.screen_loc = ui_living_pull
pull_icon.hud = src
static_inventory += pull_icon

combo_display = new /atom/movable/screen/combo()
infodisplay += combo_display

//mob health doll! assumes whatever sprite the mob is
healthdoll = new /atom/movable/screen/healthdoll/living()
healthdoll.hud = src
infodisplay += healthdoll
3 changes: 3 additions & 0 deletions code/_onclick/hud/monkey.dm
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@
zone_select.hud = src
static_inventory += zone_select

combo_display = new /atom/movable/screen/combo()
infodisplay += combo_display

mymob.client.screen = list()

using = new /atom/movable/screen/resist()
Expand Down
9 changes: 9 additions & 0 deletions code/_onclick/hud/revenanthud.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
/datum/hud/revenant
ui_style = 'icons/hud/screen_gen.dmi'

/datum/hud/revenant/New(mob/owner)
..()

pull_icon = new /atom/movable/screen/pull()
pull_icon.icon = ui_style
pull_icon.update_icon()
pull_icon.screen_loc = ui_living_pull
pull_icon.hud = src
static_inventory += pull_icon

healths = new /atom/movable/screen/healths/revenant()
healths.hud = src
infodisplay += healths
Loading
Loading