Skip to content

Commit

Permalink
Miner Style Points 2: Style on Everyone (tgstation#74690)
Browse files Browse the repository at this point in the history
## About The Pull Request
A re-open of tgstation#66326 with
Fikou's permission

Adds the style meter, it can be bought from the mining vendor for 1500
points, it is an attachment to your glasses.
The style meter creates a display on your hud, with your recent actions,
like attacking enemies, killing them, mining ore etc. Actions like
spinning or flipping increase your score multiplier, making you get more
points.
Your style meter affects how much ore you get from mining rocks. By
default with the meter, you get 20% less ore, but at the highest, you
can get 1.2x the ore from mining. In addition, on B-tier or above, you
can "hotswap" items, by attacking an item in your backpack with one in
your hand (should it fit and all that). Also features a leaderboard for
highest style point count!

New streamable: https://streamable.com/eewi6l

The following are sources of points:

- Killing things
- Killing big things
- Killing small things
- Punching things
- Melee'ing things
- Mining rocks and ores
- Having matrix traps detonate
- Hit, defuse, and detonate gibtonite
- Detonate crusher marks
- Scan geysers
- Parry projectiles (others or your own)

Oh, right. While wearing the style meter, you're able to parry any
lavaland-based projectile by clicking on it or the tile it is on, which
reflects it back in a 7 degree arc, making it 20% faster and 15% more
damaging. Usually not very easy.

Maybe-plan in the future for some syndicate variant of this (with bullet
parrying and appropriate style sources, etc.), but not for this PR

Thanks to Arcane, multitooling the style meter will make it play some
sounds on rank-up.


![image](https://user-images.githubusercontent.com/41448081/231605640-a01c2b60-1ba1-4390-8bea-0aa804ea1973.png)

https://streamable.com/nheaky

Parrying in action

## Why It's Good For The Game
Makes miners bring more ore in a fun way.

## Changelog
:cl: Fikou, Zonespace, Arcane for voicing
add: The mining vendor now has a style meter. This meter gauges your
style points and uses them to improve your ore yield.
/:cl:

---------

Co-authored-by: Fikou <[email protected]>
  • Loading branch information
Zonespace27 and Fikou authored Apr 29, 2023
1 parent 9c30cc4 commit 0d4ec59
Show file tree
Hide file tree
Showing 34 changed files with 784 additions and 12 deletions.
3 changes: 3 additions & 0 deletions code/__DEFINES/achievements.dm
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@
// DB ID for intento score
#define INTENTO_SCORE "Intento Score"

// DB ID for style point count
#define STYLE_SCORE "Style Score"

// Tourist related achievements and scores

//centcom grades (achievement)
Expand Down
22 changes: 22 additions & 0 deletions code/__DEFINES/dcs/signals/signals_mob/signals_mob_living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,25 @@

/// From /mob/living/unfriend() : (mob/living/old_friend)
#define COMSIG_LIVING_UNFRIENDED "living_unfriended"

/// From /obj/effect/temp_visual/resonance/burst() : (mob/creator, mob/living/hit_living)
#define COMSIG_LIVING_RESONATOR_BURST "living_resonator_burst"

/// From /obj/projectile/attempt_parry() : (obj/projectile/parried_projectile)
#define COMSIG_LIVING_PROJECTILE_PARRYING "living_projectile_parrying"
/// Return to allow the parry to happen
#define ALLOW_PARRY (1<<0)

/// From /obj/projectile/on_parry() : (obj/projectile/parried_projectile)
#define COMSIG_LIVING_PROJECTILE_PARRIED "living_projectile_parried"
/// Return to prevent the projectile from executing any code in on_parry()
#define INTERCEPT_PARRY_EFFECTS (1<<0)

/// From /turf/closed/mineral/gibtonite/defuse() : (det_time)
#define COMSIG_LIVING_DEFUSED_GIBTONITE "living_defused_gibtonite"

/// From /obj/item/kinetic_crusher/afterattack() : (mob/living/target, obj/item/kinetic_crusher/crusher, backstabbed)
#define COMSIG_LIVING_CRUSHER_DETONATE "living_crusher_detonate"

/// From /obj/structure/geyser/attackby() : (obj/structure/geyser/geyser)
#define COMSIG_LIVING_DISCOVERED_GEYSER "living_discovered_geyser"
2 changes: 2 additions & 0 deletions code/__DEFINES/dcs/signals/signals_mob/signals_mob_main.dm
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@
#define COMSIG_MOB_AUTOMUTE_CHECK "client_automute_check" // The check is performed by the client.
/// Prevents the automute system checking this client for repeated messages.
#define WAIVE_AUTOMUTE_CHECK (1<<0)
///From base of /turf/closed/mineral/proc/gets_drilled(): (turf/closed/mineral/rock, give_exp)
#define COMSIG_MOB_MINED "mob_mined"

///from living/flash_act(), when a mob is successfully flashed.
#define COMSIG_MOB_FLASHED "mob_flashed"
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/layers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@
#define CRIT_LAYER 5
#define CURSE_LAYER 6
#define ECHO_LAYER 7
#define PARRY_LAYER 8

#define FOV_EFFECT_LAYER 100

Expand Down
3 changes: 3 additions & 0 deletions code/_onclick/hud/fullscreen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@
icon_state = "oxydamageoverlay"
layer = BLIND_LAYER

/atom/movable/screen/fullscreen/crit/projectile_parry
layer = PARRY_LAYER

/atom/movable/screen/fullscreen/blind
icon_state = "blackimageoverlay"
layer = BLIND_LAYER
Expand Down
6 changes: 6 additions & 0 deletions code/datums/achievements/misc_scores.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,9 @@
name = "Intento Score"
desc = "A blast from the future?"
database_id = INTENTO_SCORE

/// What's the highest amount of style points we've gotten?
/datum/award/score/style_score
name = "Style Score"
desc = "You might not be a robot, but you were damn close."
database_id = STYLE_SCORE
38 changes: 38 additions & 0 deletions code/datums/components/parry.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/// Add to a living mob to allow them to "parry" projectiles by clicking on their tile, sending them back at the firer.
/datum/component/projectile_parry
/// typecache of valid projectiles to be able to parry
var/list/parryable_projectiles


/datum/component/projectile_parry/Initialize(list/projectiles_to_parry)
if(!isliving(parent))
return COMPONENT_INCOMPATIBLE

parryable_projectiles = typecacheof(projectiles_to_parry)


/datum/component/projectile_parry/RegisterWithParent()
RegisterSignal(parent, COMSIG_LIVING_PROJECTILE_PARRYING, PROC_REF(parrying_projectile))
RegisterSignal(parent, COMSIG_LIVING_PROJECTILE_PARRIED, PROC_REF(parried_projectile))


/datum/component/projectile_parry/UnregisterFromParent()
UnregisterSignal(parent, list(COMSIG_LIVING_PROJECTILE_PARRYING, COMSIG_LIVING_PROJECTILE_PARRIED))


/datum/component/projectile_parry/proc/parrying_projectile(datum/source, obj/projectile/parried_projectile)
SIGNAL_HANDLER

if(is_type_in_typecache(parried_projectile, parryable_projectiles))
return ALLOW_PARRY


/datum/component/projectile_parry/proc/parried_projectile(datum/source, obj/projectile/parried_projectile)
SIGNAL_HANDLER

var/mob/living/living_parent = parent

living_parent.playsound_local(get_turf(parried_projectile), 'sound/effects/parry.ogg', 50, TRUE)
living_parent.overlay_fullscreen("projectile_parry", /atom/movable/screen/fullscreen/crit/projectile_parry, 2)
addtimer(CALLBACK(living_parent, TYPE_PROC_REF(/mob, clear_fullscreen), "projectile_parry"), 0.25 SECONDS)
living_parent.visible_message(span_warning("[living_parent] expertly parries [parried_projectile] with [living_parent.p_their()] bare hand!"), span_warning("You parry [parried_projectile] with your hand!"))
Loading

0 comments on commit 0d4ec59

Please sign in to comment.