Debug action: apply status effect
This commit is contained in:
11
rsrc/dialogs/help-or-harm.xml
Normal file
11
rsrc/dialogs/help-or-harm.xml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
|
||||||
|
<!-- NOTE: This file should be updated to use relative positioning the next time it changes. -->
|
||||||
|
<?xml-stylesheet href="dialog.xsl" type="text/xsl"?>
|
||||||
|
<dialog>
|
||||||
|
<pict type='dlog' num='2' top='8' left='8'/>
|
||||||
|
<text size='large' top='8' left='48' width='248' height='33'>
|
||||||
|
Apply helpful status or harmful status?
|
||||||
|
</text>
|
||||||
|
<button name='harm' type='regular' def-key='-' top='42' left='238'><key/> Harm</button>
|
||||||
|
<button name='help' type='regular' def-key='shift =' top='42' left='169'><key/> Help</button>
|
||||||
|
</dialog>
|
@@ -30,6 +30,7 @@
|
|||||||
#include "fileio/fileio.hpp"
|
#include "fileio/fileio.hpp"
|
||||||
#include "fileio/resmgr/res_dialog.hpp"
|
#include "fileio/resmgr/res_dialog.hpp"
|
||||||
#include "dialogxml/dialogs/choicedlog.hpp"
|
#include "dialogxml/dialogs/choicedlog.hpp"
|
||||||
|
#include "dialogxml/dialogs/pictchoice.hpp"
|
||||||
#include "dialogxml/dialogs/dialog.hpp"
|
#include "dialogxml/dialogs/dialog.hpp"
|
||||||
#include "dialogxml/dialogs/strdlog.hpp"
|
#include "dialogxml/dialogs/strdlog.hpp"
|
||||||
#include "dialogxml/widgets/scrollbar.hpp"
|
#include "dialogxml/widgets/scrollbar.hpp"
|
||||||
@@ -2167,6 +2168,45 @@ void debug_hurt_party() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void debug_give_status() {
|
||||||
|
if(recording){
|
||||||
|
record_action("debug_give_status", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
pic_num_t which = choose_status_effect(-1, false);
|
||||||
|
if(which == -1) return;
|
||||||
|
eStatus which_status = static_cast<eStatus>(which);
|
||||||
|
std::string choice = cChoiceDlog("help-or-harm",{"harm","help"}).show();
|
||||||
|
std::pair<int, int> bounds = status_bounds(which_status);
|
||||||
|
int lo = bounds.first;
|
||||||
|
int hi = bounds.second;
|
||||||
|
status_info_t info = *which_status;
|
||||||
|
int value = 0;
|
||||||
|
if(choice == "harm"){
|
||||||
|
if(info.isNegative){
|
||||||
|
value = hi;
|
||||||
|
}else{
|
||||||
|
value = lo;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if(info.isNegative){
|
||||||
|
value = lo;
|
||||||
|
}else{
|
||||||
|
value = hi;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
short pc = select_pc(0, "Give status to who?", true);
|
||||||
|
if(pc == 6) return;
|
||||||
|
for(int i = 0; i < 6; ++i){
|
||||||
|
if(i == pc || (univ.party[i].is_alive() && pc == 7)) {
|
||||||
|
// Give PCs a status effect. Bypass apply_status because it blocks 'wrapping' for
|
||||||
|
// some opposite statuses
|
||||||
|
univ.party[i].status[which_status] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void debug_magic_map() {
|
void debug_magic_map() {
|
||||||
if(recording){
|
if(recording){
|
||||||
record_action("debug_magic_map", "");
|
record_action("debug_magic_map", "");
|
||||||
@@ -2489,7 +2529,7 @@ void debug_launch_scen(std::string scen_name) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Non-comprehensive list of unused keys:
|
// Non-comprehensive list of unused keys:
|
||||||
// chjklnoqvy -_+[]{},.'"`|;:
|
// chjklnoqvy +[]{},.'"`|;:
|
||||||
// We want to keep lower-case for normal gameplay.
|
// We want to keep lower-case for normal gameplay.
|
||||||
void init_debug_actions() {
|
void init_debug_actions() {
|
||||||
// optional `true` argument means you can use this action in the startup menu.
|
// optional `true` argument means you can use this action in the startup menu.
|
||||||
@@ -2525,6 +2565,7 @@ void init_debug_actions() {
|
|||||||
add_debug_action({'W'}, "Refresh jobs/shops", debug_refresh_stores);
|
add_debug_action({'W'}, "Refresh jobs/shops", debug_refresh_stores);
|
||||||
add_debug_action({'X'}, "Kill party", debug_kill_party);
|
add_debug_action({'X'}, "Kill party", debug_kill_party);
|
||||||
add_debug_action({'-'}, "Hurt the party", debug_hurt_party);
|
add_debug_action({'-'}, "Hurt the party", debug_hurt_party);
|
||||||
|
add_debug_action({'_'}, "Give a status effect", debug_give_status);
|
||||||
add_debug_action({'~'}, "Clear captured souls", clear_trapped_monst);
|
add_debug_action({'~'}, "Clear captured souls", clear_trapped_monst);
|
||||||
add_debug_action({'='}, "Heal, increase magic skills", debug_heal_plus_extra);
|
add_debug_action({'='}, "Heal, increase magic skills", debug_heal_plus_extra);
|
||||||
add_debug_action({'<'}, "Make one day pass", debug_increase_age);
|
add_debug_action({'<'}, "Make one day pass", debug_increase_age);
|
||||||
|
@@ -94,6 +94,7 @@ void debug_leave_town();
|
|||||||
void debug_kill();
|
void debug_kill();
|
||||||
void debug_kill_party();
|
void debug_kill_party();
|
||||||
void debug_hurt_party();
|
void debug_hurt_party();
|
||||||
|
void debug_give_status();
|
||||||
void debug_magic_map();
|
void debug_magic_map();
|
||||||
void debug_enter_town();
|
void debug_enter_town();
|
||||||
void debug_refresh_stores();
|
void debug_refresh_stores();
|
||||||
|
@@ -809,6 +809,9 @@ static void replay_action(Element& action) {
|
|||||||
}else if(t == "debug_hurt_party"){
|
}else if(t == "debug_hurt_party"){
|
||||||
debug_hurt_party();
|
debug_hurt_party();
|
||||||
return;
|
return;
|
||||||
|
}else if(t == "debug_give_status"){
|
||||||
|
debug_give_status();
|
||||||
|
return;
|
||||||
}else if(t == "debug_magic_map"){
|
}else if(t == "debug_magic_map"){
|
||||||
debug_magic_map();
|
debug_magic_map();
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user