-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74844 from Fris0uman/graveless_souls
Jsonized end screen: How I learned to stop worrying and win the Cataclysm
- Loading branch information
Showing
14 changed files
with
430 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
[ | ||
{ | ||
"type": "ascii_art", | ||
"id": "ascii_rip_cross", | ||
"picture": [ | ||
" _______ ___", | ||
" < `/ |", | ||
" > _ _ (", | ||
" | |_) | |_) |", | ||
" | | \\ | | |", | ||
" ______.__<color_green>%</color>_| |________ __", | ||
" _/ \\| |", | ||
"| <", | ||
"| |", | ||
"| |", | ||
"|_____.-._____ _/|_________|", | ||
" | |", | ||
" | |", | ||
" | <", | ||
" | |", | ||
" | _ |", | ||
" |__/ |", | ||
" <color_green>%</color> / `--. |<color_green>%</color>", | ||
" <color_red>*</color> .<color_green>%%</color>| -< <color_brown>@</color><color_green>%%%</color>", | ||
" `\\<color_green>%</color>`<color_brown>@</color>| |<color_brown>@@</color><color_green>%</color><color_brown>@</color><color_green>%%</color>", | ||
" .<color_green>%%%</color><color_brown>@@@</color>|<color_green>%</color> ` <color_green>%</color> <color_brown>@@@</color><color_green>%%</color><color_brown>@</color><color_green>%%%%</color>", | ||
" _.<color_green>%%%%%%</color><color_brown>@@@@@@</color><color_green>%%%</color>__/\\<color_green>%</color><color_brown>@@</color><color_green>%%</color><color_brown>@@@@@@@</color><color_green>%%%%%%</color>" | ||
] | ||
}, | ||
{ | ||
"type": "ascii_art", | ||
"id": "ascii_rip_inverted_cross", | ||
"picture": [ | ||
" _______ ___", | ||
" | \\/ |", | ||
" | |", | ||
" | |", | ||
" | |", | ||
" | |", | ||
" | |", | ||
" | |", | ||
" | <", | ||
" | _ |", | ||
" |__/ |", | ||
" _____.__%_| |_________ _", | ||
" _/ \\| \\", | ||
"| <", | ||
"| |", | ||
"| |", | ||
"|____.-._______ __/|__________|", | ||
" <color_green>%</color> / `_-. _ |<color_green>%</color>", | ||
" <color_red>*</color> .<color_green>%%</color>| |_) | |_)< <color_brown>@<color_green>%%%</color>", | ||
" `\\<color_green>%</color>`<color_brown>@</color>| | \\ | | |<color_brown>@@</color><color_green>%@<color_green>%%</color>", | ||
" .<color_green>%%%</color><color_brown>@@@</color>|<color_green>%</color> ` <color_green>%</color> <color_brown>@@@</color><color_green>%%</color><color_brown>@</color><color_green>%%%%</color>", | ||
" _.<color_green>%%%%%%</color><color_brown>@@@@@@</color><color_green>%%%</color>__/\\<color_green>%</color><color_brown>@@</color><color_green>%%</color><color_brown>@@@@@@@</color><color_green>%%%%%%</color>" | ||
] | ||
}, | ||
{ | ||
"type": "ascii_art", | ||
"id": "ascii_tombstone", | ||
"picture": [ | ||
" _________ ____ ", | ||
" _/ `/ \\_ ", | ||
" _/ _ _ \\_. ", | ||
" _<color_green>%</color>\\ |_) | |_) \\_ ", | ||
" _/ \\/ | \\ | | \\_ ", | ||
" _/ \\_ ", | ||
"| |", | ||
" ) < ", | ||
"| |", | ||
"| |", | ||
"| _ |", | ||
"|__/ |", | ||
" / `--. |", | ||
"| ( ", | ||
"| |", | ||
"| |", | ||
"| <color_green>%</color> . |", | ||
"| <color_brown>@</color>` <color_green>%%</color> |", | ||
"| <color_green>%</color><color_brown>@</color><color_green>%</color><color_brown>@</color><color_green>%</color>\\ <color_red>*</color> <color_green>%</color>`<color_green>%</color><color_brown>@</color><color_green>%</color>|", | ||
"<color_green>%%</color><color_brown>@@@</color>.<color_green>%</color><color_brown>@</color><color_green>%</color>\\<color_green>%%</color> `\\ <color_green>%%</color>.<color_green>%%</color><color_brown>@@</color><color_green>%</color><color_brown>@</color>", | ||
"<color_brown>@</color><color_green>%</color><color_brown>@@</color><color_green>%%%%%</color><color_brown>@@@@@@</color><color_green>%%%%%%%%</color><color_brown>@@</color><color_green>%%</color><color_brown>@@@</color><color_green>%%%</color><color_brown>@</color><color_green>%%</color><color_brown>@</color>" | ||
] | ||
}, | ||
{ | ||
"type": "ascii_art", | ||
"id": "ascii_portal_storm_win", | ||
"picture": [ | ||
" ", | ||
" <color_light_blue>|</color> ", | ||
" <color_light_blue>-.-</color> ", | ||
" <color_light_blue>|</color> ", | ||
" ", | ||
" ", | ||
" <color_yellow>|</color> ", | ||
" <color_yellow>_._</color> ", | ||
" <color_yellow>|</color> ", | ||
" ", | ||
" ", | ||
" ", | ||
" <color_yellow>|</color> ", | ||
" <color_yellow>-.-</color> ", | ||
" <color_yellow>|</color> ", | ||
" ", | ||
" <color_light_blue>|</color> ", | ||
" <color_light_blue>_._</color> ", | ||
" <color_light_blue>|</color> ", | ||
" ", | ||
" ", | ||
" " | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
[ | ||
{ | ||
"type": "end_screen", | ||
"id": "death_tombstone", | ||
"priority": 0, | ||
"picture_id": "ascii_tombstone", | ||
"condition": { "not": "u_is_alive" }, | ||
"added_info": [ | ||
[ [ 6, 8 ], "In memory of: <u_name>" ], | ||
[ [ 13, 9 ], "Survived: <time_survived>" ], | ||
[ [ 15, 10 ], "Kills: <total_kills>" ] | ||
], | ||
"last_words_label": "Last Words:" | ||
}, | ||
{ | ||
"type": "end_screen", | ||
"id": "death_cross", | ||
"priority": 100, | ||
"picture_id": "ascii_rip_cross", | ||
"condition": { | ||
"and": [ | ||
{ "not": "u_is_alive" }, | ||
{ | ||
"or": [ { "u_has_item": "holybook_bible1" }, { "u_has_item": "holybook_bible2" }, { "u_has_item": "holybook_bible3" } ] | ||
}, | ||
{ "not": { "and": [ { "u_has_trait": "CANNIBAL" }, { "u_has_trait": "PSYCHOPATH" } ] } } | ||
] | ||
}, | ||
"added_info": [ | ||
[ [ 8, 8 ], "In memory of: <color_green><u_name></color>" ], | ||
[ [ 15, 9 ], "Survived: <time_survived>" ], | ||
[ [ 17, 10 ], "Kills: <total_kills>" ] | ||
], | ||
"last_words_label": "Last Words:" | ||
}, | ||
{ | ||
"type": "end_screen", | ||
"id": "death_inverted_cross", | ||
"priority": 100, | ||
"picture_id": "ascii_rip_inverted_cross", | ||
"condition": { "and": [ { "not": "u_is_alive" }, { "or": [ { "u_has_trait": "CANNIBAL" }, { "u_has_trait": "PSYCHOPATH" } ] } ] }, | ||
"added_info": [ | ||
[ [ 8, 14 ], "In memory of: <color_green><u_name></color>" ], | ||
[ [ 15, 15 ], "Survived: <time_survived>" ], | ||
[ [ 17, 16 ], "Kills: <total_kills>" ] | ||
], | ||
"last_words_label": "Last Words:" | ||
}, | ||
{ | ||
"type": "end_screen", | ||
"id": "portal_storm_win", | ||
"priority": 200, | ||
"picture_id": "ascii_portal_storm_win", | ||
"condition": { "and": [ { "not": "u_is_alive" }, { "u_has_effect": "a_winner_is_u" } ] }, | ||
"added_info": [ | ||
[ [ 6, 6 ], "You <color_pink>won</color>" ], | ||
[ [ 8, 7 ], "<u_name>..." ], | ||
[ [ 4, 10 ], "...<u_name>, who's that?" ], | ||
[ [ 15, 11 ], "Not your problem anymore." ], | ||
[ [ 9, 15 ], "What a <color_pink>success</color>." ], | ||
[ [ 4, 21 ], "Something struggled for: <time_survived>" ] | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from ..write_text import write_text | ||
|
||
|
||
def parse_end_screen(json, origin): | ||
if "last_words_label" in json: | ||
write_text(json["last_words_label"], origin, | ||
comment="String used to label the last word input prompt." | ||
"ex: \"Last Words:\")") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#include "assign.h" | ||
#include "condition.h" | ||
#include "end_screen.h" | ||
#include "generic_factory.h" | ||
|
||
namespace | ||
{ | ||
generic_factory<end_screen> end_screen_factory( "end_screen" ); | ||
} // namespace | ||
|
||
template<> | ||
const end_screen &string_id<end_screen>::obj()const | ||
{ | ||
return end_screen_factory.obj( *this ); | ||
} | ||
|
||
template<> | ||
bool string_id<end_screen>::is_valid() const | ||
{ | ||
return end_screen_factory.is_valid( *this ); | ||
} | ||
|
||
void end_screen::load_end_screen( const JsonObject &jo, const std::string &src ) | ||
{ | ||
end_screen_factory.load( jo, src ); | ||
} | ||
|
||
void end_screen::load( const JsonObject &jo, std::string_view ) | ||
{ | ||
mandatory( jo, was_loaded, "id", id ); | ||
mandatory( jo, was_loaded, "picture_id", picture_id ); | ||
mandatory( jo, was_loaded, "priority", priority ); | ||
read_condition( jo, "condition", condition, false ); | ||
|
||
optional( jo, was_loaded, "added_info", added_info ); | ||
optional( jo, was_loaded, "last_words_label", last_words_label ); | ||
} | ||
|
||
const std::vector<end_screen> &end_screen::get_all() | ||
{ | ||
return end_screen_factory.get_all(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#pragma once | ||
#ifndef CATA_SRC_DEATH_SCREEN_H | ||
#define CATA_SRC_DEATH_SCREEN_H | ||
|
||
#include <iosfwd> | ||
#include <vector> | ||
|
||
#include "ascii_art.h" | ||
#include "effect_on_condition.h" | ||
#include "type_id.h" | ||
|
||
class JsonObject; | ||
|
||
struct end_screen { | ||
public: | ||
static void load_end_screen( const JsonObject &jo, const std::string &src ); | ||
|
||
void load( const JsonObject &jo, std::string_view ); | ||
static const std::vector<end_screen> &get_all(); | ||
bool was_loaded = false; | ||
|
||
end_screen_id id; | ||
ascii_art_id picture_id; | ||
std::function<bool( dialogue & )> condition; | ||
int priority; | ||
std::vector<std::pair<std::pair<int, int>, std::string>> added_info; | ||
std::string last_words_label; | ||
}; | ||
|
||
#endif // CATA_SRC_DEATH_SCREEN_H |
Oops, something went wrong.