void cScreenTown::do_walk() { if (g_WalkAround) { g_MessageQue.AddToQue(gettext("You can only do this once per week."), 2); return; } sGirl *girl = g_Girls.GetRandomGirl(); // let's get a girl for the player to meet if (girl == 0) // if there's no girl, no meeting { g_MessageQue.AddToQue(walk_no_luck(), 0); return; } // most of the time, you're not going to find anyone unless you're cheating, of course. int meet_chance = cfg.initial.girl_meet(); if (!g_Dice.percent(meet_chance) && !g_Cheats) { g_MessageQue.AddToQue(walk_no_luck(), 1); return; } if (girlimage_id != -1) { if (girl) { SetImage(girlimage_id, g_Girls.GetImageSurface(girl, IMGTYPE_PROFILE, true, ImageNum)); if (g_Girls.IsAnimatedSurface(girl, IMGTYPE_PROFILE, ImageNum)) SetImage(girlimage_id, g_Girls.GetAnimatedSurface(girl, IMGTYPE_PROFILE, ImageNum)); HideImage(girlimage_id, false); } else HideImage(girlimage_id, true); } // I'd like to move this to the handler script - once scripts are stable string message = "You go out searching around town for any new girls. You notice a potential new girl and walk up to her."; g_MessageQue.AddToQue(message, 2); int v[2] = { 0, -1 }; cTrigger* trig = 0; DirPath dp; string filename; cScriptManager sm; if (!(trig = girl->m_Triggers.CheckForScript(TRIGGER_MEET, false, v))) { dp = DirPath() << "Resources" << "Scripts" << "MeetTownDefault.script"; // no, so trigger the default one } else { if (cfg.folders.configXMLch()) dp = DirPath() << cfg.folders.characters() << girl->m_Name << trig->m_Script; else dp = DirPath() << "Resources" << "Characters" << girl->m_Name << trig->m_Script; // trigger the girl-specific one } eventrunning = true; sm.Load(dp, girl); return; }
void cArenaTry::do_walk() { if (g_TryOuts) { g_MessageQue.AddToQue("You can only do this once per week.", COLOR_RED); return; } /* * let's get a girl for the player to meet */ sGirl *girl = g_Girls.GetRandomGirl(false, false, true); /* * if there's no girl, no meeting */ if (girl == 0) { g_MessageQue.AddToQue(walk_no_luck(), COLOR_RED); return; } /* * most of the time, you're not going to find anyone * unless you're cheating, of course. */ int meet_chance = cfg.initial.girl_meet(); if (!g_Dice.percent(meet_chance) && !g_Cheats) { g_MessageQue.AddToQue(walk_no_luck(), COLOR_RED); return; } /* * I'd like to move this to the handler script * * once scripts are stable */ string message = "You hold open try outs to all girls willing to step into the arena and fight for their life."; g_MessageQue.AddToQue(message, COLOR_BLUE); int v[2] = { 3, -1 }; cTrigger* trig = 0; g_Building = BUILDING_ARENA; DirPath dp; string filename; cScriptManager sm; /* * is there a girl specific talk script? */ if (!(trig = girl->m_Triggers.CheckForScript(TRIGGER_MEET, false, v))) { // no, so trigger the default one dp = DirPath() << "Resources" << "Scripts" << "MeetArenaTry.script"; } else { // trigger the girl-specific one dp = DirPath(cfg.folders.characters().c_str()) << girl->m_Name << trig->m_Script; } eventrunning = true; sm.Load(dp, girl); return; }
void cCastingTry::do_walk() { if (g_TryCast) { g_MessageQue.AddToQue("You can only do this once per week.", 2); return; } sGirl *girl = g_Girls.GetRandomGirl(); //let's get a girl for the player to meet if (girl == 0) // if there's no girl, no meeting { g_MessageQue.AddToQue(walk_no_luck(), COLOR_RED); return; } /* * most of the time, you're not going to find anyone * unless you're cheating, of course. */ int meet_chance = cfg.initial.girl_meet(); if (!g_Dice.percent(meet_chance) && !g_Cheats) { g_MessageQue.AddToQue(walk_no_luck(), COLOR_RED); return; } /* * I'd like to move this to the handler script * * once scripts are stable */ string message = ""; int pre = g_Dice % 2; if (pre == 1) message = "You need a new girl for your next film. You set up a public casting call."; else message = "You hold an open casting call to try to get a new actress for your movies."; g_MessageQue.AddToQue(message, COLOR_BLUE); int v[2] = { 0, -1 }; cTrigger* trig = 0; g_Building = BUILDING_STUDIO; DirPath dp; string filename; cScriptManager sm; /* * is there a girl specific talk script? */ if (!(trig = girl->m_Triggers.CheckForScript(TRIGGER_MEET, false, v))) { // no, so trigger the default one dp = DirPath() << "Resources" << "Scripts" << "MeetCastingTry.script"; } else { // trigger the girl-specific one dp = DirPath(cfg.folders.characters().c_str()) << girl->m_Name << trig->m_Script; } eventrunning = true; sm.Load(dp, girl); }
void cScreenTown::do_walk() { if (g_WalkAround) { g_MessageQue.AddToQue("You can only do this once per week.", COLOR_RED); return; } sGirl *girl = g_Girls.GetRandomGirl(); // let's get a girl for the player to meet if (girl == 0) // if there's no girl, no meeting { g_MessageQue.AddToQue(walk_no_luck(), COLOR_RED); return; } // most of the time, you're not going to find anyone unless you're cheating, of course. if (!g_Dice.percent(cfg.initial.girl_meet()) && !g_Cheats) { g_MessageQue.AddToQue(walk_no_luck(), COLOR_BLUE); return; } if (girlimage_id != -1) { if (girl) { PrepareImage(girlimage_id, girl, IMGTYPE_PROFILE, true, ImageNum); HideImage(girlimage_id, false); } else HideImage(girlimage_id, true); } int v[2] = { 0, -1 }; cTrigger* trig = 0; DirPath dp; DirPath intro; string introfile = ""; string message = ""; cScriptManager sm; // is there a girl specific talk script? if (!(trig = girl->m_Triggers.CheckForScript(TRIGGER_MEET, false, v))) { // no, so trigger the default one introfile = "MeetTownDefault.script.intro"; intro = DirPath() << "Resources" << "Scripts"; dp = DirPath() << "Resources" << "Scripts" << "MeetTownDefault.script"; // no, so trigger the default one } else { // trigger the girl-specific one introfile = trig->m_Script + ".intro"; intro = DirPath(cfg.folders.characters().c_str()) << girl->m_Name; dp = DirPath(cfg.folders.characters().c_str()) << girl->m_Name << trig->m_Script; } FileList abstest(intro, introfile.c_str()); if (abstest.size() == 0) { message = "You go out searching around town for any new girls. You notice a potential new girl and walk up to her."; } else { message = ""; ifstream in; in.open(abstest[0].full()); in >> message; in.close(); } if (message.size() > 0) g_MessageQue.AddToQue(message, COLOR_BLUE); eventrunning = true; sm.Load(dp, girl); return; }