Skip to content

Commit

Permalink
Dance with Draco in the refugee center (#68517)
Browse files Browse the repository at this point in the history
* Dodge

* Lint

* Style

* Spelling

* Move to u_val

* Update data/json/npcs/refugee_center/surface_refugees/NPC_Draco_Dune.json

Co-authored-by: TheShadowFerret <[email protected]>

---------

Co-authored-by: TheShadowFerret <[email protected]>
  • Loading branch information
Light-Wave and TheShadowFerret authored Oct 7, 2023
1 parent 79b7f32 commit fb73a6d
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 0 deletions.
89 changes: 89 additions & 0 deletions data/json/npcs/refugee_center/surface_refugees/NPC_Draco_Dune.json
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,11 @@
"effect": { "u_add_var": "NC_REFUGEE_Draco_offered_weed_deal", "type": "general", "context": "barter", "value": "yes" },
"topic": "TALK_REFUGEE_Draco_8"
},
{
"text": "Do you know any tunes good to dance to?",
"condition": { "u_has_var": "NC_REFUGEE_Draco_has_guitar", "type": "general", "context": "mission", "value": "yes" },
"topic": "TALK_REFUGEE_Draco_Dance"
},
{ "text": "See you around, Draco.", "topic": "TALK_DONE" }
]
},
Expand Down Expand Up @@ -435,6 +440,90 @@
{ "text": "You're welcome. Later.", "topic": "TALK_DONE" }
]
},
{
"type": "talk_topic",
"id": "TALK_REFUGEE_Draco_Dance",
"dynamic_line": "Sure thing, friend! Let's see how you can move to this one.",
"responses": [
{ "text": "Just a sec, got somethig I need to do first.", "topic": "TALK_DONE" },
{
"text": "[Shuffle back and forth a little]",
"topic": "TALK_REFUGEE_Draco_Dance_1",
"condition": { "math": [ "u_val('dodge')", "<", "1" ] },
"switch": true
},
{
"text": "[Do a little dance]",
"topic": "TALK_REFUGEE_Draco_Dance_2",
"condition": { "math": [ "u_val('dodge')", "<", "6" ] },
"switch": true
},
{
"text": "[Perform a decent dance]",
"topic": "TALK_REFUGEE_Draco_Dance_3",
"condition": { "math": [ "u_val('dodge')", "<", "10" ] },
"switch": true
},
{
"text": "[Perform an impressive dance]",
"topic": "TALK_REFUGEE_Draco_Dance_4",
"condition": { "math": [ "u_val('dodge')", "<", "15" ] },
"switch": true
},
{
"text": "[Perform an masterful dance]",
"topic": "TALK_REFUGEE_Draco_Dance_5",
"condition": { "math": [ "u_val('dodge')", "<", "20" ] },
"switch": true
},
{
"text": "[Perform a legendary dance]",
"topic": "TALK_REFUGEE_Draco_Dance_6",
"condition": { "math": [ "u_val('dodge')", ">", "20" ] },
"switch": true,
"default": true
}
]
},
{
"type": "talk_topic",
"id": "TALK_REFUGEE_Draco_Dance_1",
"dynamic_line": "Not in the mood to dance, huh? Or perhaps you should try wearing something less encumbering. You know, if you want to.",
"responses": [
{ "text": "I'll consider it. Thanks for the tunes.", "topic": "TALK_REFUGEE_Draco_7" },
{ "text": "Thanks, Later.", "topic": "TALK_DONE" }
]
},
{
"type": "talk_topic",
"id": "TALK_REFUGEE_Draco_Dance_2",
"dynamic_line": "Ah yes, that's the spirit! This place could sure use more dancing.",
"responses": [ { "text": "Cheers!", "topic": "TALK_REFUGEE_Draco_7" }, { "text": "Cheers! Later.", "topic": "TALK_DONE" } ]
},
{
"type": "talk_topic",
"id": "TALK_REFUGEE_Draco_Dance_3",
"dynamic_line": "Oh my, am I dealing with a professional dancer here? Sweet moves, friend.",
"responses": [ { "text": "Thanks!", "topic": "TALK_REFUGEE_Draco_7" }, { "text": "Cheers! Later.", "topic": "TALK_DONE" } ]
},
{
"type": "talk_topic",
"id": "TALK_REFUGEE_Draco_Dance_4",
"dynamic_line": "Oh my oh my. That was impressive! Sweet moves!",
"responses": [ { "text": "Thanks!", "topic": "TALK_REFUGEE_Draco_7" }, { "text": "Cheers! Later.", "topic": "TALK_DONE" } ]
},
{
"type": "talk_topic",
"id": "TALK_REFUGEE_Draco_Dance_5",
"dynamic_line": "Daym. You're probably the best dancer I've ever had the honor of meeting. Well done. Well done indeed.",
"responses": [ { "text": "Thanks!", "topic": "TALK_REFUGEE_Draco_7" }, { "text": "Cheers! Later.", "topic": "TALK_DONE" } ]
},
{
"type": "talk_topic",
"id": "TALK_REFUGEE_Draco_Dance_6",
"dynamic_line": "Oh wow. I didn't even know the human body could move like that. I don't know what to say. That was amazing!",
"responses": [ { "text": "Thanks!", "topic": "TALK_REFUGEE_Draco_7" }, { "text": "Cheers! Later.", "topic": "TALK_DONE" } ]
},
{
"id": "MISSION_REFUGEE_Draco_GET_GUITAR",
"type": "mission_definition",
Expand Down
1 change: 1 addition & 0 deletions doc/NPCs.md
Original file line number Diff line number Diff line change
Expand Up @@ -1265,6 +1265,7 @@ Example | Description
`"u_val": "hp"` | Amount of hp. If `bodypart` is provided it will be for that part otherwise it will be the sum of all parts.
`"u_val": "warmth"` | Amount of warmth in a given bodypart. `bodypart` is the id of the part to use.
`"u_val": "effect_intensity"` | Intensity of an effect. `effect` is the id of the effect to test and `bodypart` is optionally the body part to look at. If the effect is not present a -1 is returned.
`"u_val": "dodge"` | Current effective dodge of the character.
`"u_val": "pos_x"` | Player character x coordinate. "pos_y" and "pos_z" also works as expected.
`"u_val": "power"` | Bionic power in millijoule.
`"u_val": "power_max"` | Max bionic power in millijoule. Can be read but not written to.
Expand Down
4 changes: 4 additions & 0 deletions src/condition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1815,6 +1815,10 @@ std::function<double( dialogue & )> conditional_t::get_get_dbl( J const &jo )
bodypart_id bid = bp.value_or( get_bp_from_str( d.reason ) );
return d.actor( is_npc )->get_cur_part_temp( bid );
};
} else if( checked_value == "dodge" ) {
return [is_npc]( dialogue const & d ) {
return d.actor( is_npc )->get_character()->get_dodge();
};
} else if( checked_value == "effect_intensity" ) {
const std::string &effect_id = jo.get_string( "effect" );
std::optional<bodypart_id> bp;
Expand Down
1 change: 1 addition & 0 deletions src/math_parser_diag.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ using decl_diag_ass = std::function<void( dialogue &, double )> ( char scope,

decl_diag_eval armor_eval;
decl_diag_eval attack_speed_eval;
decl_diag_eval dodge_eval;
decl_diag_eval effect_intensity_eval;
decl_diag_eval hp_eval;
decl_diag_ass hp_ass;
Expand Down

0 comments on commit fb73a6d

Please sign in to comment.