Skip to content

Commit

Permalink
it's tested and seems to work!
Browse files Browse the repository at this point in the history
  • Loading branch information
jjinkou2 committed Oct 13, 2016
1 parent e658cc5 commit 68ca30b
Showing 1 changed file with 51 additions and 31 deletions.
82 changes: 51 additions & 31 deletions doax3-xp-grin-v0.5.gpc
Original file line number Diff line number Diff line change
Expand Up @@ -139,19 +139,29 @@ define paper_Premium = 10;
/*-------------------------*/
/* List of Items */
/*-------------------------*/
define IllusionA = 0;
define IllusionB = 1;
// tab 0
define MummyA = 2;
define MummyI = -6;
define PeaceD = 8;
define PeaceH = 6;
define Caviar = 12;
define PeanutF = 15;
define AsariA = -7;
define AsariI = -15;
define EelE = 18;
define DecupleI = 21;
define SandwichA = 30;
define SandwichA = -16;
define SandwichI = -24;

define Dangerous = 0;
// tab 1
define Sidecar = 2;

//tab2
define Dangerous = 0;
define Tempting = 1;
define Forbidden = -1;
define Secret = -2;
define Forbidden = 2;
define Secret = -1;
define MoebieusSlow = 3;
define HardGelEx = -6;


define All = 255;

Expand All @@ -167,17 +177,18 @@ define Buy_At_X = 3; // will try to buy at every X vacations
// Select a Character to Farm,
// Possible Values [Hitomi, Helena, ..., All]
// if you put All, it will farm a new character each vacation.
define CharacterToPlay = All;
define CharacterToPlay = Kokoro;


int Items; // dont' touch this one.

int Tab1 = 0, FromRow1 = IllusionA, ToRow1 = IllusionA, Paper1 = paper_Helena; // only one for Helena
//int Tab2 = 0, FromRow2 = SandwichA, ToRow2 = EelE, Paper2 = paper_Kokoro; // a range of swimsuits
//int Tab3 = 2, FromRow3 = Dangerous, ToRow3 = Secret, Paper3 = paper_Honoka; // a range of tickets
//int Tab4 = 1, FromRow4 = 7, ToRow4 = 18, Paper4 = All; // anything at tab 2 from 7 to 18 to all
// for instance godfather...
//int Tab1 = 0, FromRow1 = MummyC, ToRow1 = MummyC, Paper1 = paper_Helena; // only one for Helena
//int Tab2 = 0, FromRow2 = SandwichA, ToRow2 = EelE, Paper2 = paper_Kokoro; // a range of swimsuits
//int Tab3 = 2, FromRow3 = Dangerous, ToRow3 = Tempting, Paper3 = paper_Honoka; // a range of tickets
//int Tab4 = 1, FromRow4 = 7, ToRow4 = 18, Paper4 = All; // anything at tab 1 from 7 to 18 to all
// for instance godfather...
//int Tab5 = 2, FromRow5 = -3, ToRow5 = 3, Paper_5 = paper_Hitomi; //other items like pose tickets
int Tab6 = 0, FromRow6 = AsariA, ToRow6 = AsariI, Paper6 = paper_Silver; // take all Asari in silver

int EndofItems = 255;

Expand Down Expand Up @@ -227,6 +238,8 @@ define S_Clear_Vacation = 51;
define S_Start_Game = 80;
define S_End_Game = 81;

define S_Debug = 90;

define S_IDLE = 100;

// indices used for the data structure
Expand Down Expand Up @@ -534,16 +547,17 @@ main {
if (event_press(PS4_L2)) DebugCombo (cb_end_vacation, 0); // test a combe

// R3 to test a whole State
if (event_press(PS4_R3)) {Play = TRUE;State = S_Select_Tab;} // test a whole state
if (event_press(PS4_R3)) {Play = TRUE;State = S_Debug;} // test a whole state

// L1 to adjust the numday (look at TRACE_4)
if (event_press(PS4_L1)) {
NumDay = NumDay % 15 + 1 ;// adjust the numDay if script is stopped
set_val(TRACE_4,NumDay); // Trace 4 will display the # day
}
/* if (event_press(PS4_UP)) {
/* if (event_press(PS4_UP)) {
loop_vacation = loop_vacation % Nb_Vacations + 1 ;
set_val(TRACE_2,loop_vacation);

}*/
}

Expand All @@ -552,7 +566,8 @@ main {
if (Play) {

// intro States
if (State == S_Start_Game) State = StartGame();

if (State == S_Start_Game) State = StartGame();
if (State == S_Start_Intro) run_State(cb_intro,0, S_Select_Char);
if (State == S_Select_Char) run_State(cb_left_char, Selected_Char, S_Start_Vacation);
if (State == S_Start_Vacation) run_State(cb_start_vacation,0, S_Start_RockPlay);
Expand All @@ -568,7 +583,7 @@ main {
else {loop_event = Nb_Events; run_State(cb_abort_rock_play, 0, S_Hotel);}
}
//if (State == S_Clear_Event) Repeat_ThenGoto(PS4_SQUARE,Nb_Notifs, S_Hotel);

// At the Hotel
if (State == S_Hotel) {
if ((NumDay == 1) && !(loop_vacation % Buy_At_X))
Expand All @@ -578,18 +593,17 @@ main {

// Shopping Items at X vacations
if (State == S_Owner_Shop) run_State(cb_owner_shop, 0, S_Select_Tab);

if (State == S_Select_Tab)
{
set_val(TRACE_6,Item_Tab); // Look at the loop
Repeat_ThenGoto(PS4_RIGHT, Item_Tab, 2, S_Select_Item);
}

//if (State == S_Debug) run_State(cb_owner_shop, 12, S_Select_Tab); //uncomment this to test items to buy

if (State == S_Select_Tab) Repeat_ThenGoto(PS4_RIGHT, Item_Tab, 2, S_Select_Item);
if (State == S_Select_Item) select_Item_ThenGoto(S_Buy_Item);
if (State == S_Buy_Item) run_State(cb_buy_item, 0, S_Select_Paper);
if (State == S_Buy_Item) run_State(cb_buy_item, 0, S_Select_Paper);
if (State == S_Select_Paper) Repeat_ThenGoto(PS4_RIGHT, ItemPaper, 2, S_Wrap);
if (State == S_Wrap) run_State(cb_paper, 0, S_Exit_Shop);
if (State == S_Exit_Shop) exit_Shop_ThenGoto(S_Throw_Gift);

//if (State == S_Exit_Shop) exit_Shop_ThenGoto(S_Debug); // uncomment this to test items to buy

// End of hotel
if (State == S_Throw_Gift) run_State(cb_throw_gift, 0, S_Go_Bed);
if (State == S_Go_Bed) run_State(cb_go_bed, 0, S_End_Day);
Expand Down Expand Up @@ -695,7 +709,7 @@ function get_combo_index(combo_id) {

function StartGame(){
loop_event = Nb_Events - 1; // only Afternoon & evening

if (CharacterToPlay == All) {
if (Selected_Char == MarieRose) Selected_Char = Ayane;
else Selected_Char = (Selected_Char + 2) % 20;
Expand Down Expand Up @@ -726,8 +740,8 @@ function run_State(combo_to_run,offset,next) {

function select_Item_ThenGoto (next){
if (abs(ItemFromRow - ItemToRow) != 0) { // items are on several rows
if (ItemFromRow <= ItemToRow) PressButton = PS4_UP;
else PressButton = PS4_DOWN;
if (ItemFromRow > 0) PressButton = PS4_UP;
else PressButton = PS4_DOWN;
}
else // only one item
{
Expand All @@ -740,11 +754,16 @@ function select_Item_ThenGoto (next){

function exit_Shop_ThenGoto(next){
if (Items[index_item + 3] == All) {
if (ItemPaper%10) next_Item();
if (ItemPaper%10 == 0){
ItemPaper = 1;
next_Item();
}
else ItemPaper = ItemPaper % 10 + 1;
}
else next_Item();
State = next;

set_val(TRACE_6,5); // Trace_6 available for debug
return;
}

Expand All @@ -762,6 +781,8 @@ function next_Item(){
ItemFromRow = Items[index_item + 1];
ItemToRow = Items[index_item + 2];
ItemPaper = Items[index_item + 3];
if (ItemPaper == All) ItemPaper = 1;
else ItemPaper = Items[4];
}
return;
}
Expand All @@ -770,7 +791,6 @@ function next_Item(){
function Repeat_ThenGoto(button, times, speed, next) {
PressButton = button;
wait_time = speed * 50; // x * 50 ms of waiting
set_val(TRACE_5,times); // Look at the loop
if (abs(loop_button) < times ) {
if (!combo_running(cb_Repeat_Button)) combo_restart (cb_Repeat_Button);
}
Expand Down

0 comments on commit 68ca30b

Please sign in to comment.