0 Members and 2 Guests are viewing this topic.
... potpt("mp", "mpmax", "mppotion")...function potpt(statstr,statmaxstr,potstr) boostamt = 0 loadstring(potstr.."="..potstr.."-1")() boostamt = math.random(1,dexterity) loadstring(statstr.."="..statstr.."+boostamt")() if loadstring("if "..statstr..">"..statmaxstr.." then return true")() then loadstring(statstr.."="..statmaxstr)() end combatLine1 = "You drink an "..statstr.." potion... +"..boostamt.." "..statstr.."."end
--------------------------------------------------------------------------------function savegame()-------------------------------------------------------------------------------- --Current savegame process. Split up because the Nspire losses variables after 14 entries-- local game_save = {} game_save[1] = {race,arrows,arrowtyp,bag,bankgold,bomb,bow,boss1,boss2,boss3,boss4,burn,day,defboost} game_save[2] = {defense,potion_def,dexboost,potion_dex,dexterity,distance,enburn,enlife,enpois,game,gold,gotboss1,gotboss2,gotboss3} game_save[3] = {gotboss4,helm,herb,hp,hpmax,potion_hp,intboost,intelligence,potion_int,lamp,level,molotov,mp,mpmax} game_save[4] = {potion_mp,orb,points,poisdag,pois,ring,ringcure,ringfear,ringhealth,ringl33t,ringsight,ringtrain,ringwealth,robe} game_save[5] = {shield,shoes,skillretreat,skillrun,skillscan,speboost,special,speed,spellbolt,spellheal,spellstat,spellstun,potion_spe} game_save[6] = {strboost,strength,potion_str,stun,sword,xp,armor} for i=1, 6 do var.store("save.game" .. i, game_save[i]) end --Scan is already a table, so its just saved as a table var.store("save.game7", scan)end
function combatLineCycle() for i=1,7 do combatLine[9-i] = combatLine[8-i] endend
function on.save() game_save = {} game_save[1] = {race,arrows,arrowtyp,bag,bankgold,bomb,bow,boss1,boss2,boss3,boss4,burn,day,boost_def} game_save[2] = {defense,potion_def,boost_dex,potion_dex,dexterity,distance,en_burn,en_life,en_pois,game,gold,gotboss1,gotboss2,gotboss3} game_save[3] = {gotboss4,helm,herb,hp,hpmax,potion_hp,boost_int,intelligence,potion_int,lamp,level,molotov,mp,mpmax} game_save[4] = {potion_mp,orb,points,poisdag,pois,ring,ring_cure,ring_fear,ring_health,ring_l33t,ring_sight,ring_train,ring_wealth,robe} game_save[5] = {shield,shoes,skill_retreat,skill_run,skill_scan,boost_spe,special,speed,spell_bolt,spell_heal,spell_stat,spell_stun,potion_spe} game_save[6] = {boost_str,strength,potion_str,stun,sword,xp,armor} game_save[7] = scan return game_saveendfunction on.restore(save) local game_load1 = save[1] local game_load2 = save[2] local game_load3 = save[3] local game_load4 = save[4] local game_load5 = save[5] local game_load6 = save[6] if game_load1 == nil then --Then there is no save game and it displays as such else race = game_load1[1] armor = game_load6[7] arrows = game_load1[2] ...etc.. end end