// Exploring/Hunting /*jshint multistr:true*/ function getPlaceCnt(place) { if (isNaN(places[place])) return 0; return places[place]; } function setPlaceVisited(place) { if (isNaN(places[place])) places[place] = 1; else places[place] += 1; } function Forage() { if ($("#forage_buttons").is(":visible")) { $("#camp_feed").html(""); return; } if ($("#women_buttons").is(":visible")) resetRival(); if (player.round > 10 && getPlaceCnt("Volcano") === 0) { setPlaceVisited("Volcano"); Message(NextWindow, "
You see a mountain smoking with red rivers flowing down it's side. Looks dangerous, but maybe you return there another time?"); return; } $("#camp_feed").html( "
You find small strange melon, it may feed your clan
", "eatSmallMelonYou", "eatSmallMelonWoman", 1); else if (val < 20) WanderFood("You find strange mushroom, with long and stiff shape, it may feed your clan
", "eatMushroomYou", "eatMushroomWoman", 1); else if (val < 30) WanderFood("You find strange and heacy melon, it may feed your clan
", "eatMelonYou", "eatMelonWoman", 2); else if (val < 35) WanderFood("You find small nut, you feel the force of your ancestors in it
", "eatMaternalNutYou", "eatMaternalNutWoman", 2); else if (val < 55) WanderFood("You find small nut, you feel the force of your ancestors in it
", "eatDominationNutYou", "eatDominationNutWoman", 1); else if (val < 65) WanderFood("You find small green berry that smells strange, it may feed your clan
", "eatGreenBerryYou", "eatGreenBerryWoman", 1); else if (val < 75) WanderFood("You find small pale berry that smells strange, it may feed your clan
", "eatPaleBerryYou", "eatPaleBerryWoman", 1); else if (val < 85) WanderFood("You find small dark coloured berry that smells strange, it may feed your clan
", "eatDarkBerryYou", "eatDarkBerryWoman", 1); else if (val < 95) WanderFood("You find small multicoloured flower that looks surprisingly edible, it may feed your clan
", "eatRainbowflowerYou", "eatRainbowflowerWoman", 1); else WanderBattle("cold swamp"); } ); }; if (getPlaceCnt("Beach") !== 0) { $("#forage_buttons").append(""); $("#forage_button_beach").click( function(){ if (FindRandomEvent("Beach")) return; var val = getRandomInt(1, 100); if (val < 20) WanderFood("You find small nut, you feel the force of your ancestors in it
", "eatMaternalNutYou", "eatMaternalNutWoman", 1); else if (val < 35) WanderFood("You find strange mushroom, with long and stiff shape, it may feed your clan
", "eatMushroomYou", "eatMushroomWoman", 1); else if (val < 50) WanderFood("You find small nut, you feel the force of your ancestors in it
", "eatAllureNutYou", "eatAllureNutWoman", 1); else if (val < 65) WanderFood("You find small fruit look like paw, you feel the force of your ancestors in it
", "eatPawFruitYou", "eatPawFruitWoman", 1); else if (val < 80) WanderFood("You find strange sea creature, long and slimy with three bodies, it may feed your clan
", "eatTriCreatureYou", "eatTriCreatureWoman", 1); else if (val < 90) WanderFood("You find a large nut, it may feed your clan
", "eatHairyNutYou", "eatHairyNutWoman", 1); else if (val < 95) WanderNothing(); else WanderBattle("chilly beach"); } ); }; if (getPlaceCnt("Volcano") !== 0) { $("#forage_buttons").append(""); $("#forage_button_volcano").click( function(){ if (FindRandomEvent("Volcano")) return; var val = getRandomInt(1, 100); if (val < 20) WanderFood("You find small nut, you feel the force of your ancestors in it
", "eatDominationNutYou", "eatDominationNutWoman", 1); else if (val < 45) WanderFood("You find small nut, you feel the force of your ancestors in it
", "eatAllureNutYou", "eatAllureNutWoman", 1); else if (val < 65) WanderFood("You find long nut, you feel the force of your ancestors in it
", "eatOrientationNutYou", "eatOrientationNutWoman", 1); else if (val < 85) WanderFood("You find small nut, you feel the force of your ancestors in it
", "eatMaternalNutYou", "eatMaternalNutWoman", 2); else if (val < 95) WanderFood("You find small red nut that smells of fire, it may feed your clan
", "eatDemonNutYou", "eatDemonNutWoman", 1); else if (val < 95) WanderFood("You find strange mushroom, with long and stiff shape and two stalks, it may feed your clan
", "eatTwinMushroomYou", "eatTwinMushroomWoman", 1); else WanderBattle("hot volcano"); } ); } if (smith.goods > 0) { $("#forage_buttons").append(""); $("#forage_button_smith").click(function(){TradeSmith();}); } $("#forage_button_forest").click( function(){ if (FindRandomEvent("Forest")) return; var val = getRandomInt(1, 100); if (val < 20) WanderFood("You find small nut, you feel the force of your ancestors in it
", "eatDominationNutYou", "eatDominationNutWoman", 1); else if (val < 40) WanderFood("You find small nut, you feel the force of your ancestors in it
", "eatAllureNutYou", "eatAllureNutWoman", 1); else if (val < 50) WanderFood("You find strange mushroom, with long and stiff shape, it may feed your clan
", "eatMushroomYou", "eatMushroomWoman", 1); else if (val < 70) WanderFood("You find some odd grapes, with double berries, it may feed your clan
", "eatGrapesYou", "eatGrapesWoman", 1); else if (val < 95) WanderFood("You find strange melon, it may feed your clan
", "eatMelonYou", "eatMelonWoman", 1); else WanderBattle("snow forest"); } ); $("#forage_button_hills").click( function(){ if (FindRandomEvent("Hills")) return; var val = getRandomInt(1, 100); if (val < 20) WanderFood("You find small nut, you feel the force of your ancestors in it
", "eatDomesticNutYou", "eatDomesticNutWoman", 1); else if (val < 35) WanderFood("You find long nut, you feel the force of your ancestors in it
", "eatOrientationNutYou", "eatOrientationNutWoman", 1); else if (val < 50) WanderFood("You find strange mushroom, with long and stiff shape, it may feed your clan
", "eatMushroomYou", "eatMushroomWoman", 1); else if (val < 75) WanderFood("You find small white nut that smells of milk, it may feed your clan
", "eatMilkNutYou", "eatMilkNutWoman", 1); else if (val < 85) WanderFood("You find strange melon, it may feed your clan
", "eatMelonYou", "eatMelonWoman", 1); else if (val < 95) { if (smith.goods > 0) WanderFood("You find small nut, you feel the force of your ancestors in it
", "eatAllureNutYou", "eatAllureNutWoman", 1); else if (smith.round > 0) TradeSmith(); else MeetSmith(); } else WanderBattle("snow hills"); } ); } function Hunt() { if ($("#wander_buttons").is(":visible")) { $("#camp_feed").html(""); return; } if ($("#women_buttons").is(":visible")) resetRival(); if (player.round > 10 && getPlaceCnt("Volcano") === 0) { setPlaceVisited("Volcano"); EndRound(Message(NextWindow, "You see a mountain smoking with red rivers flowing down it's side. Looks dangerous, but maybe you return there another time?")); return; } $("#camp_feed").html( "
You find nothing. Return to ${leader.name} empty handed.
`); EndRound(); return; } rival = undefined; // A quest? // - Hunt for Weshptah checkBoss1(plc); if (rival === undefined) { // Any runaways if (runaways.length > 0 && getRandomInt(1, 100) < 10) { rival = runaways[getRandomInt(0, runaways.length - 1)]; rival.experience += 5; EncounterNamedRival(); } else { // Generic Rival var exp = Math.floor(player.getTrainingRanks() * (getRandomInt(40, 120) / 100)) * 5; createRival(exp); } } var bAvoid = player.Mods.perception > 0 && (player.Mods.perception * 5) >= getRandomInt(0, 100); var str = "You wander through " + plc + " until spot lone man"; if (bAvoid) { // can avoid str += ". He no see you yet"; } str += " " + rival.getRecognise(); if (bAvoid) { str += ".
" + "" + ""; } else { str += ". He see you and grin. He think you become womanfolk of his clan. He wrong."; str += "." + "" } str += ""; $("#output").html(str); $("#fight_button_fight").click( function(){ Battle(rival, false); } ); $("#fight_button_leave").click( function() { Message(NextWindow, "You no want this weakling and leave him."); EndRound(); } ); $("#fight_button_auto").click( function() { Battle(rival, true); } ); } // Found a consumable item (common function) function WanderFood(desc, actionyou, actionwoman, pow) { $("#output").html(desc); $("#output").append("You store it away to be used as needed for crafting.
"); EndRound(); }); } function FindRandomEvent(plc) { setPlaceVisited(plc); if (getRandomInt(1, 100) > 10) return false; // No event var val = getRandomInt(1, 100); if (val < 10 && getPlaceCnt("Swamp") == 0) { setPlaceVisited("Swamp"); Message(NextWindow, "You find a foul smelling wet place, full of many things to hunt, you must return here
"); } else if (val < 50) FindAbandonedCamp(); else WanderNothing(); EndRound(); return true; } // Find nothing function WanderNothing() { Message(NextWindow, "You failed to hunt anything or anyone, and return to camp
"); } // find abandoned camp function FindAbandonedCamp() { player.goods += getRandomInt(1, 10); var val = getRandomInt(1, 100); if (val < 25) Message(NextWindow, "You find a camp for a clan, look like it not used for long time. You find some things left behind and take back to your camp.
"); else if (val < 50) Message(NextWindow, "You find a camp for a clan, it damaged, most things are burned. You see signs of people dragged away. You find some things left behind and take back to your camp.
"); else if (val < 75) { if (getPlaceCnt("Volcano") !== 0 && !player.checkSwitch(1)) { rival = new Avatar(20, 60, 70, 70, 80); rival.Mods.breasts = 200; rival.name = "Osiris"; redraw(); $("#output").html( 'You find a camp for a clan, it damaged, most things are burned. You look and find some things left behind and take back to your camp.
\As you gather a woman challenges you!
\
"Stop, this not your clan!"
\
She has huge breasts, and looks at you defiantly
\
"My man..was taken by a red woman away to the mountain of fire..but he return..soon"
\
You see she not believe it, and you think her man now serving that woman, as slave or full of her babies. You tell woman you take care of her and she become member of your clan. She look confused, wanting to wait for her man, but wanting safety of a clan
\ \ \ '); redraw(); $("#take_woman").click(function () { rival.dysphoria = 0; redraw(); $(".stats").hide(); player.women.push(rival); Message(NextWindow, "You tell her that she now your woman! Her man now slave of red woman, and no hope for him. She say,
\
"Me be your woman if you give me oath on your anccestors, take that red woman as slave!
\This your desire so you give oath on ancestors spirits. She laugh in joy and tell you her name 'Osiris'
\ "); }); $("#reject_woman").click(function() { Message(NextWindow, "You tell her to wait for her man. She look hopeful, you doubt you see her again."); }); player.setSwitch(1); } else Message(NextWindow, "You find a camp for a clan, it damaged, most things are burned. You see signs of people dragged away. You find some things left behind and take back to your camp.
"); } else Message(NextWindow, "You find a camp for a clan, it is empty, and you think it one that died out in the long winter and no women-folk. Sadly you look around and find some things abandoned and take back to your camp.
"); }