LastBattle

By extio on Sep 16, 2011

ok... so i wanted an action based text game. so... after wasting much time i realized no one wants to play me that i know.... sssooooo i made an AI to play. lol. anyways because it passes insane number of parameters, i could, theoritacally just decide how much energy an attack will use and such and make any cool commands i want. because everything is function bassed, i can make an AI use an attack i design for the users. too bad its sooooo confusing...

but it works fine. if you want to battle AI just get on a channel with the bot, running seperate, type ~register. type ~engage. and finally type ~trainONE. attacks are ~attack nick , and the special attacks i was going to unlock as you level up, which you do level up and get stronger now, but the attacks dont unlock and it doesnt tell you commands so you will have to look at the script to figure all that out....

anyways im storing it here till i pick it up and add status ailments, more attacks, a and a multiplayer story mode where there is puzzle solving, enemies, and more.

it will be HUGE one day cause its huge now and its not even 1/3 completed. all you can do right now is play people and the AI in a training mode.

*edit

OK, i changed up how the damage calc works, you now pay energy before you attack with a alias. i call on this alias as a custom identifier to see if it should continue to deal the damage, this is so i dont have to halt the script, making a lot of the AI stuff easier, and reducing the number of parameters i pass to damagecalc by 2. rewrote all the parameter passes, and added a delayed attack called shockwave.

list of things to do in order...
add poison and sleep status ailments
make attacks level based, and unlockable.
add sword items findable in single player
build single player mode.

also, considering using mirc ascii art to draw a map for single player for each area... a pain but doable...

10/25/11
added a location system backbone, keeps track of player via a grid, move with Move East, Move West, etc. added delayed attack shockwave, most attacks are now unlockable, but not finalized. increased time for attacks to reward smarter play and reduce lag while script processes effect on battles.
10/26/11
reranged code entirely to be easy to work on and understand. added comments, improved help notices.
10/27/11
changed around some more, added more location aliases, now crafting room text in INI file. fixed level up glitch in battle system. working on glitch in movement system...
10/28/11
Added status effect system's backbone. added a test poison attack, uses levels of poison. shortened some command code, reduced redundancy. added registers for a few swords and all status effects.
11/5/11
Added a Shopping menu, then purchase system alias. works by passing parameters in large numbers, but it works. worked on gameplay of first area, text file being built. wrote lines of story.
02/10/2012
the script the game uses can now be found at http://pastebin.com/e68ShhwQ
02/12/2012
changed and re-arranged various mechanics, added story, shortened text in battles.
02/17/2012
changed battle system, all attacks now working toward modular. can bring in new attacks from another script soon i hope. am going to change maps to be the same. considerable updated information display in battle. reduced "text wall" effect. found several AI glitches and corrected. advanceds storyline to first AI battle, added to tutorial. various text errors corrected. added "walls" to player navigation system, making it easier to understand why you cant move a direction.

; temporary Developer commands - should be removed in use ----------------------------

on *:text:!exit:#:{
  /quit LastBattleScript, Requested
}
on *:text:!leave:#:{
  /part $chan lastbattle
}

; this section for on: join, part, quit, etc ----------------------------

on *:PART:#:{
  var %u users_ $+ $nick
  if ($readini(lastbattle.ini,%u,engaged) == 1) {
    disengage $nick $chan
  }
}

; this section for common use aliases, multipurpose first ----------------------------

; this subsection for Neccessary checks for engage, life, playing game, etc ----------

alias haltChecks {
  var %u users_ $+ $1
  if ($readini(lastbattle.ini,%u,engaged) != 1) {
    msg $Chan $1 Your not even engaged in battle!
    halt
  }
  if ($readini(lastbattle.ini,%u,Ready) != 1) {
    overextended 2 0 $2 $1
    if ($1 != %currentAI) { halt }
  }
}

alias haltChecks2 {
  var %i users_ $+ $1
  if ($readini(lastbattle.ini,%i,engaged) != 1) {
    msg $2 Enemy $1 is not engaged.
    halt
  }
}

alias checkCaps {
  var %u users_ $+ $1
  if ($readini(lastbattle.ini,%u,energy) > $readini(lastbattle.ini,%u,energyCap)) {
    writeini lastbattle.ini %u energy $readini(lastbattle.ini,%u,energyCap)
  }
  if ($readini(lastbattle.ini,%u,hp) > $readini(lastbattle.ini,%u,lifeCap)) {
    writeini lastbattle.ini %u life $readini(lastbattle.ini,%u,lifeCap)
  }
  if ($readini(lastbattle.ini,%u,energy) < 0) {
    writeini lastbattle.ini %u energy 0
  }
  if ($readini(lastbattle.ini,%u,life) < 1) {
    writeini lastbattle.ini %u life 0
    if ( $readini(lastbattle.ini,%u,engaged) == 1) {
      msg $2 $1 FAINTED.
      disengage $1 $2
      writeini lastbattle.ini %u EXP 0
      writeini lastbattle.ini %u locks none
    }
  }
}

; this subsection for battle alias ----------

alias statusAilment {
  echo StatusCheck
  var %u users_ $+ $1
  var %trueOrFalse true
  if ($readini(lastbattle.ini,%u,poison) > 0) {
    writeini lastbattle.ini %u life $calc($readini(lastbattle.ini,%u,life) - $readini(lastbattle.ini,%u,poison))
    if ($readini(lastbattle.ini,%u,life) > 0) {
      msg $2 $1 is hurt by poison!  Loses $readini(lastbattle.ini,%u,poison) life. $readini(lastbattle.ini,%u,life) life remaining.
    }  
    if ($readini(lastbattle.ini,%u,life) < 1) {
      msg $2 $1 is hurt by poison!  Loses all life remainining!.
      writeini lastbattle.ini %u life 0
      checkCaps $1 $2
      var %trueOrFalse false
    }
  }
  if ($readini(lastbattle.ini,%u,sleep) > 0) {
    msg $2 $1 is asleep.
    if ($rand(1,10) >  $readini(lastbattle.ini,%u,sleep)) {
      msg $2 $1 woke up!
      writeini lastbattle.ini %u sleep 0
    } 
    else {
      msg $2 $1 stays fast asleep.
      var %trueOrFalse false
    }
  }
  return %trueOrFalse
}

; inflictStatus breakdown, ($1 = $nick, $2 = $chan, 3= targeted nick, 4= ailment to apply, 5= N ailment level greater than 0, 6= number 1-8 chance to resist effect.)

alias inflictStatus {
  var %u users_ $+ $1
  var %i users_ $+ $3
  var %res $readini(lastbattle.ini,%i,res)
  if ($rand(1,10) > $calc($6+%res)) {
    msg $2 $3 was inflicted with $4!
    writeini lastbattle.ini %i $4 $5
  }
  else {
    msg $2 $3 resisted $4!
  }
}

; breakdown of $ddif( users_nick of attack = 1 , users_nick of def = 2)  returns a value! 
; used to determine difference of attack and defense in damage calc

alias DDif {
  var %dif $calc($readini(lastbattle.ini,$1,atk) - $readini(lastbattle.ini,$2,def) + $3)
  if (%dif < 2) { var %dif 2 }
  return %dif
}

; breakdown of  $energyCostOrGain( nick = 1 , energy use or add = 2 , chan = 3)  returns a value!

alias energyCostOrGain {
  var %u users_ $+ $1
  var %h recovers
  if ($2 < 0) {
    if ($readini(lastbattle.ini,%u,energy) < $abs($2) && $1 != %currentAI) { 
      msg $3 You need at least $abs($2) energy for this attack!
      overextended 1 2 $3 $1
      return 0
    }
    var %h uses
  }
  var %a $calc($readini(lastbattle.ini,%u,energy) + $2)
  writeini lastbattle.ini %u energy %a
  msg $3 $1 %h $abs($2) energy and then has $readini(lastbattle.ini,%u,energy) energy remaining.
  return true
}

alias overextended {
  var %u users_ $+ $4
  msg $3 Not ready or not enough energy! $4 overextends, and loses $1 energy and $2 life.
  writeini lastbattle.ini %u energy $calc($readini(lastbattle.ini,%u,energy) - $1)
  writeini lastbattle.ini %u life $calc($readini(lastbattle.ini,%u,life) - $2)
  checkCaps $4 $3
}

; damagecalc parameter breakdown is (target nick = 1, damage = 2, time to wait afterward = 3, user of attack = 4, channel of user = 5)
alias damageCalc {
  var %u users_ $+ $4
  var %i users_ $+ $1
  checkCaps $4 $5 
  checkCaps $1 $5
  haltChecks2 $1 $5
  if ($3 != 0) {
    haltChecks $4 $5 
  }
  else {
    if ($readini(lastbattle.ini,%u,engaged) != 1) {
      msg $3 $1 Your not even engaged in battle!
      halt
    }  
  }
  haltChecks2 $1 $5
  var %u users_ $+ $4
  var %i users_ $+ $1
  if ($readini(lastbattle.ini,%i,life) > 0) { 
    writeini lastbattle.ini %i life $calc($readini(lastbattle.ini,%i,life) - $2)
    if ($3 != 0) {
      writeini lastbattle.ini %u Ready 0
    }
    if ($readini(lastbattle.ini,%i,life) <= 0) { 
      msg $5 $4 deals $1 $calc($2 + $readini(lastbattle.ini,%i,life)) damage. $1 has 0 life remaining.
      checkCaps $4 $5 
      checkCaps $1 $5
      msg $5 Battle Over!
      $expUP($1,$calc(($readini(lastbattle.ini,%i,Level) / $readini(lastbattle.ini,%u,Level)) / 2),$5,$4)
      writeini lastbattle.ini %i EXP 0
      writeini lastbattle.ini %u locks none
      if ($readini(lastbattle.ini,%u,engaged) == 1) { readyTime $3 $4 $5 }
      halt
    }
    else {
      checkCaps $4 $5 
      checkCaps $1 $5
      msg $5 $4 deals $1 $2 damage.  $1 has 4 $readini(lastbattle.ini,%i,life)  life remaining.
      $expUP($1,$calc(($readini(lastbattle.ini,%i,Level) / $readini(lastbattle.ini,%u,Level)) / 20),$5,$4)
    }
  } 
  else { 
    msg $5 attacking... wait, no, because hes already fainted!  is this an error?  halting.
    halt
  }
  if ($3 != 0) {
    if ($readini(lastbattle.ini,%u,engaged) == 1) { readyTime $3 $4 $5 }
  }
}

alias disengage {
  var %u users_ $+ $1
  writeini lastbattle.ini %u engaged 0
  writeini lastbattle.ini %u Ready 0
  timer $+ $1 off
  msg $2 $1 Disengages battle
  if (%userTarget != %u && $readini(lastbattle.ini,%userTarget,locks) == all) {
    if (%userCurrentAI == %u) {
      $readini(lastbattle.ini,%u,Xaxis) $+ _ $+ $readini(lastbattle.ini,%u,Yaxis) $1 $2 advance
    }

  }
}

alias readyCheckSay {
  var %u users_ $+ $1
  if ($readini(lastbattle.ini,%u,engaged) == 1) {
    msg $2 $1 Ready!
    writeini lastbattle.ini %u Ready 1
  }
  ; else { echo $2 $1 is no longer engaged, ready though (linebreak) writeini lastbattle.ini %u Ready 1 }   
}

alias readyTime {
  timerReady $+ $2 1 $1 readyCheckSay $2 $3
  msg $3 $2 has $1 seconds to ready status
}

; this secondary subsection for attack aliases --

alias shockwaveHit {
  haltChecks2 $2 $3
  var %u users_ $+ $1
  var %i users_ $+ $2
  if ($readini(lastbattle.ini,%u,engaged) != 1) {
    msg $3 $1 Shockwave attack fizzled: Your not even engaged in battle!
    halt
  }  
  msg $3 Shockwave Connects!
  $damageCalc($2,$calc($readini(lastbattle.ini,%u,atk) - $readini(lastbattle.ini,%i,def) + 20),0,$1,$3)
}

alias jumpkick {
  var %u users_ $+ $1
  var %i users_ $+ $3
  if ($readini(lastbattle.ini,%u,level) > 0) {
    if ($energyCostOrGain($1,-3,$2)) {
      notice $1 Humans alone can't take flight, but the high jump can feel like it.  $nick Takes to the air to land heavy on those that stand against his/her plight.
      msg $2 $1 $+ : jumpkick special effect: +1 atk and def for 30 seconds after attack.
      $damageCalc($3,($DDif(%u,%i,12),12,$1,$2)
      writeini lastbattle.ini %u atk $calc($readini(lastbattle.ini,%u,atk)+1)
      writeini lastbattle.ini %u def $calc($readini(lastbattle.ini,%u,def)+1)  
      timer 1 30 writeini lastbattle.ini %u def $readini(lastbattle.ini,%u,permanentDef)
      timer 1 30 writeini lastbattle.ini %u atk $readini(lastbattle.ini,%u,permanentAtk)
    }
  }
}

alias shockwave {
  var %i users_ $+ $3
  var %u users_ $+ $1
  if ($readini(lastbattle.ini,%u,level) > 1) {
    notice $1 Like a ripple of water, the waves of shock are compressed air, moving as fast as the eye can see.  $1 launches a Shockwave attack backwards, and the wave travels off in the distance... it will reflect on the bounds of space.
    msg $2 $1  $+ : : Shockwave special effect: Hits 30 seconds after the attack is launched.  Does considerable damage.
    if ($energyCostOrGain($1,-16,$2)) {
      timer 1 30 shockwaveHit $1 $3 $2
      writeini lastbattle.ini %u Ready 0  
      readyTime 15 $1 $2
    }
  }
}

alias focuspunch {
  var %i users_ $+ $3
  var %u users_ $+ $1
  if ($readini(lastbattle.ini,%u,level) > 0) {
    if ($energyCostOrGain($1,-12,$2)) {
      notice $1 The fist is a dangerous weapon on the correct arm.  $1 collects energy to deliver a strong punch, the very shockwave produced by the impact terrifying.
      msg $2 $1 $+ : focuspunch special effect: Ignores defenses.  After this attack, for 25 secs, energy recovery is boosted by 2.
      $damageCalc($3,$calc($readini(lastbattle.ini,%u,atk)+ 10),12,$1,$2)
      writeini lastbattle.ini %u rec $calc($readini(lastbattle.ini,%u,rec)+2) 
      timer 1 25 writeini lastbattle.ini %u rec $readini(lastbattle.ini,%u,PermanentRec) 
    }   
  }
}

alias slash {
  var %i users_ $+ $3
  var %u users_ $+ $1
  if ($readini(lastbattle.ini,%u,level) > 1) {
    if ($energyCostOrGain($1,-20,$2)) {
      notice $1 Since the begginning of time, swords have been in existence.  Angels weild them.  Now $1 takes up an iron sword to crush the enemy.
      $damageCalc($3,$DDif(%u,%i,20),5,$1,$2)
    }
  }
}

alias poisonstrike {
  var %i users_ $+ $3
  var %u users_ $+ $1
  echo Poison!!!
  if ($readini(lastbattle.ini,%u,level) > 0) {
    if ($energyCostOrGain($1,-7,$2)) {
      notify $1 Attempted to poison.
      inflictStatus $1 $2 $3 poison 2 1
      $damageCalc($3,$DDif(%u,%i,5),4,$1,$2)
    }
  }
}

; this subsection for non battle alias ----------

alias expUP {
  var %u users_ $+ $4
  var %i users_ $+ $1
  echo $3 exp up! $4 (diagnostic info) + $2
  writeini lastbattle.ini %u EXP $calc($readini(lastbattle.ini,%u,EXP) + $2)
  if ($readini(lastbattle.ini,%u,EXP) > $readini(lastbattle.ini,%u,Level)) { msg $3 Level up ready.  Will be applied on ~disengage. }
}

alias levelUp {
  var %u users_ $+ $1
  echo leveling up %u
  writeini lastbattle.ini %u level $calc($readini(lastbattle.ini,%u,level) + 1)
  writeini lastbattle.ini %u lifeCap $calc($readini(lastbattle.ini,%u,lifeCap) + 10)
  writeini lastbattle.ini %u life $calc($readini(lastbattle.ini,%u,lifeCap) - 10)
  writeini lastbattle.ini %u energy $calc($readini(lastbattle.ini,%u,energyCap) - 20)
  writeini lastbattle.ini %u energyCap $calc($readini(lastbattle.ini,%u,energyCap) + 10)
  var %k = 1
  while (%k <= 3) {
    var %r $rand(1,2)
    if (%r == 1) { writeini lastbattle.ini %u permanentAtk $calc($readini(lastbattle.ini,%u,permanentAtk) + 1) }
    if (%r == 2) { writeini lastbattle.ini %u permanentDef $calc($readini(lastbattle.ini,%u,permanentDef) + 1) }
    if ($2 != $null) {
      msg $2 $1 %r so (2 is def up, 1 is attack up)
    }
    inc %k
  }
  writeini lastbattle.ini %u atk $readini(lastbattle.ini,%u,permanentAtk)
  writeini lastbattle.ini %u def $readini(lastbattle.ini,%u,permanentDef)
  writeini lastbattle.ini %u permanentRec $calc($readini(lastbattle.ini,%u,permanentRec) + 1)
  writeini lastbattle.ini %u rec $readini(lastbattle.ini,%u,permanentRec)
  writeini lastbattle.ini %u EXP 0
  if ($2 != $null) {
    msg $2 $1 LEVELED UP to level $readini(lastbattle.ini,%u,level).
    showCommands $1 battle
  }
  echo success level
}

alias registerStats {
  writeini lastbattle.ini %StatSet Yaxis 1
  writeini lastbattle.ini %StatSet Xaxis 1
  writeini lastbattle.ini %StatSet locks none
  writeini lastbattle.ini %StatSet level 1
  writeini lastbattle.ini %StatSet EXP 0
  writeini lastbattle.ini %StatSet life 50
  writeini lastbattle.ini %StatSet lifeCap 60
  writeini lastbattle.ini %StatSet energy 7
  writeini lastbattle.ini %StatSet energyCap 20
  writeini lastbattle.ini %StatSet atk 2
  writeini lastbattle.ini %StatSet def 2
  writeini lastbattle.ini %StatSet permanentAtk 2
  writeini lastbattle.ini %StatSet permanentDef 2
  writeini lastbattle.ini %StatSet permanentRec 2
  writeini lastbattle.ini %StatSet res 0
  writeini lastbattle.ini %StatSet sleep 0
  writeini lastbattle.ini %StatSet poison 0
  writeini lastbattle.ini %StatSet blind 0
  writeini lastbattle.ini %StatSet frozen 0
  writeini lastbattle.ini %StatSet ironedSword 0
  writeini lastbattle.ini %StatSet steeledSword 0
  writeini lastbattle.ini %StatSet poisonedSword 0
  writeini lastbattle.ini %StatSet gravitatedSword 0
  writeini lastbattle.ini %StatSet electrifiedSword 0
  writeini lastbattle.ini %StatSet burnedSword 0
  writeini lastbattle.ini %StatSet lightedSword 0
  writeini lastbattle.ini %StatSet frozenSword 0
  writeini lastbattle.ini %StatSet phasedSword 0
  writeini lastbattle.ini %StatSet holiedSword 0  
  writeini lastbattle.ini %StatSet Ready 0
  writeini lastbattle.ini %StatSet engaged 0
  writeini lastbattle.ini %StatSet HairCutStoryArc 0
  writeini lastbattle.ini %StatSet CommandsStoryArc 0
  writeini lastbattle.ini %StatSet IntroStoryArc 0
  writeini lastbattle.ini %StatSet 1ForrestStoryArc 0
  writeini lastbattle.ini %StatSet 1GuardianStoryArc 0
  writeini lastbattle.ini %StatSet stones 15
  var %k = 1
  while (%k < $1) {
    levelup $2
    echo level modding $2 %k
    inc %k
  }
}

alias showCommands {
  var %u users_ $+ $1
  if ($2 == complete || $2 == basic) {
    notice $1 Game option related commands require ! in front, they are rarely used: 
    notice $1 !register - sets and resets the game, all stats, scores, and levels.  Using this resets ALL progress!
    notice $1 !intro - starts the intro to the game, !start works too.
    notice $1 !engage - places you in a mode where you can attack and be attacked.  allows use of battle commands.
    notice $1 !disengage - removes engaged mode from player.
  }
  notice $1 !commands (battle|nonbattle|basic) - shows commands of specified type.
  if ($2 == complete || $2 == battle) {
    notice $1 -----
    notice $1 Battle comands require a . in front. commands are as follows:
    if ($readini(lastbattle.ini,%u,level) > 0) {
      notice $1 [attack (target)] - deals damage 
      notice $1 to enemy and recovers energy for user.
      notice $1 [jumpkick (target)] - costs: 3 energy.
      notice $1 An attack that costs energy, 
      notice $1 boost stats temporarily after use.
      notice $1 [focuspunch (target)] - costs: 12
      notice $1 energy. Ignores regular defence.
      notice $1 [recover] - restores 
      notice $1 energy and 1 life.
    }
    if ($readini(lastbattle.ini,%u,level) > 1) {
      notice $1 [shockwave (target)] - cost: * energy.
      notice $1 A delayed powerful attack.
    }
    if ($readini(lastbattle.ini,%u,level) > 2) {
      notice $1 [heal] - restores
      notice $1 small health in battle.
    }
  }
  if ($2 == complete || $2 == nonbattle) {
    notice $1 -----
    notice $1 Non-battle comands require a , in front. commands are as follows:
    notice $1 [move] (south|east|north|west) -
    notice $1 Needs to have a direction, moves
    notice $1 player in single player mode
    notice $1 [look] - allows player to
    notice $1 look around in the current area
    notice $1 [visit] (structure)- allows player to
    notice $1 visit a building or structure or place
    notice $1 [examine] (object)- allows player to
    notice $1 get detailed information on an object
    notice $1 [talk to] (npcPlayer)- allows player to
    notice $1 advance by talking to npc players 
    notice $1 [shop] (storename)- allows player to
    notice $1 display shop menus from stores
    notice $1 [buy] (item) - allows player to
    notice $1 buy items from a store in the area
  }
}

alias Look {
  var %u users_ $+ $1
  if ($3 != $null) {
    var %locationUL $readini(lastbattle.ini,%u,Xaxis) $+ _ $+ $readini(lastbattle.ini,%u,Yaxis) $+ _ $+ Text $+ $3
    echo $readini(lastbattle.ini,%u,Xaxis) $+ _ $+ $readini(lastbattle.ini,%u,Yaxis) $+ _ $+ Text $+ $3
  }
  else {
    var %locationUL $readini(lastbattle.ini,%u,Xaxis) $+ _ $+ $readini(lastbattle.ini,%u,Yaxis) $+ _ $+ Text
    echo $readini(lastbattle.ini,%u,Xaxis) $+ _ $+ $readini(lastbattle.ini,%u,Yaxis) $+ _ $+ Text
  }
  msg $2 $readini(lastbattleScript.ini,GameText,%locationUL)
}

; shop breakdown (nick, chan, displayorbuy, store name, number of items + prices for sale, item one, price for item one, item two, price for item two, etc.

alias Shop {
  var %u users_ $+ $1  
  if ($3 == display) {
    msg $2 Welcome to $4
    var %i = 6
    while (%i <= $calc(4 + $5)) {
      var %combined $ $+ %i
      var %combined2 Buy $chr(91) $+ [ [ %combined ] ] $+ $chr(93)
      inc %i
      var %combined $ $+ %i
      var %combined4 for [ [ %combined ] ] stones
      msg $2 Shop: %combined2 %combined4
      inc %i
    }
  }
  if ($3 == buy) {
    if ($readini(lastbattle.ini,%u,stones) >= $7) {
      writeini lastbattle.ini %u stones $calc($readini(lastbattle.ini,%u,stones) - $7)
      msg $2 You pay $7 stones and buy one $6 $+ .
      writeini lastbattle.ini %u $6 $calc($readini(lastbattle.ini,%u,$6) + 1)
    }
    else {
      msg $2 Sorry but you dont have enough stones to buy $6 $+ .
    }
  }
}

; this section for AI process aliases ----------------------------

alias AIspawn {
  set %StatSet users_ $+ %CurrentAI
  set %AIu users_ $+ %CurrentAI
  var %randNum $rand(0,2)
  var %i $calc(($readini(lastbattle.ini,%userTarget,Level) - 1) + %randNum)
  if (%i < 1) { %i = 1 }
  if (%i > 10) { %i = 10 }
  registerStats %i %CurrentAI
  msg $chan %CurrentAI entered the battlefield.
  set %userCurrentAI users_ $+ %CurrentAI
  msg $Chan %CurrentAI has $readini(lastbattle.ini,%userCurrentAI,life) life remaining.
  msg $Chan %CurrentAI has $readini(lastbattle.ini,%userCurrentAI,energy) energy remaining.
  msg $Chan %CurrentAI has $readini(lastbattle.ini,%userCurrentAI,EXP) EXP unused.
  msg $Chan %CurrentAI is at level $readini(lastbattle.ini,%userCurrentAI,Level).
  msg $Chan %CurrentAI is %randNum level modded
  writeini lastbattle.ini %userCurrentAI Ready 1
  writeini lastbattle.ini %userCurrentAI engaged 1
  msg $Chan %CurrentAI $+ 's engaged value is $readini(lastbattle.ini,%userCurrentAI,engaged)
  timerAI 1 10 AIproc
}

alias AIprocBounce {
  timerAI 1 $1 AIproc 
}

alias AIproc {
  msg %currentChan %CurrentAI proccesses. (diagnostic info)
  checkCaps %userTarget %currentChan
  if ($readini(lastbattle.ini,%userTarget,engaged) != 1) {
    msg %currentChan AI's Enemy is not engaged.
    halt
    } else {
    if ($readini(lastbattle.ini,%userCurrentAI,engaged) != 1) {
      msg %currentChan AI attack stop.
      halt
      } else {
      if ($readini(lastbattle.ini,%userCurrentAI,Ready) != 1) {
        msg $chan %CurrentAI overextends!  (no current penalty(insert retry here to be coded later))
        } else {
        if ($statusAilment(%CurrentAI,%currentChan)) {
          if ($readini(lastbattle.ini,%userCurrentAI,energy) > 3) {
            var %j $rand(1,10)
          }
          if ($readini(lastbattle.ini,%userCurrentAI,energy) > 10 && $readini(lastbattle.ini,%userCurrentAI,level) > 1) {
            var %j $rand(1,13)
          }
          if ($readini(lastbattle.ini,%userCurrentAI,energy) < 4) {
            var %j $rand(1,8)
          }
          echo current random of AI is %j
          if (%j >= 3 && %j <= 8) {
            echo random 1 to 8 active
            if ($energyCostOrGain(%CurrentAI,$readini(lastbattle.ini,%userCurrentAI,rec),%currentChan) == true && $readini(lastbattle.ini,%userCurrentAI,Ready) == 1) {
              $damageCalc(%userTargetNick,$calc(($readini(lastbattle.ini,%userCurrentAI,atk) - $readini(lastbattle.ini,%userTarget,def)) + 4 + $rand(0,3)),13,%CurrentAI,%currentChan)
              echo damage 1 to 8 occured
            }
          }
          if (%j > 8 && %j <= 11) {
            echo random 8 to 11 active
            if ($energyCostOrGain(%CurrentAI,-4,%currentChan) == true && $readini(lastbattle.ini,%userCurrentAI,Ready) == 1) {
              msg %currentChan used Rushing Darkness! The very Scream it emits tears at your soul.
              $damageCalc(%userTargetNick,$calc(($readini(lastbattle.ini,%userCurrentAI,atk) - $readini(lastbattle.ini,%userTarget,def)) + 10 + $rand(0,4)),12,%CurrentAI,%currentChan)
            }
          }
          if (%j <= 2) { 
            msg %currentChan AI's attack missed!
            if ($readini(lastbattle.ini,%AIu,engaged) == 1) { readyTime 13 %CurrentAI %currentChan }
          }
          if (%j > 11 && %j <= 13) {
            if ($energyCostOrGain(%CurrentAI,-10,%currentChan) == true && $readini(lastbattle.ini,%userCurrentAI,Ready) == 1) {
              msg %currentChan used Take Life.  It deals heavy damage then heals 10 life.
              var %y = $calc($readini(lastbattle.ini,%userCurrentAI,life) + 10)
              writeini lastbattle.ini %userCurrentAI life %y
              $damageCalc(%userTargetNick,$calc(($readini(lastbattle.ini,%userCurrentAI,atk) - $readini(lastbattle.ini,%userTarget,def)) + 8 + $rand(1,2)),13,%CurrentAI,%currentChan)
            }
          }
        }
      }
    }
  }
  var %z $rand(1,2)
  AIprocBounce $calc(13+%z)
}

; Player location system for single player in this section ----------------------------

alias PlayerLocation {
  var %u users_ $+ $1
  var %xaxis $readini(lastbattle.ini,%u,Xaxis)
  var %yaxis $readini(lastbattle.ini,%u,Yaxis)
  var %location %xaxis $+ _ $+ %yaxis
  echo $3
  if ($readini(lastbattle.ini,%u,locks) != all) {
    if ($3 == East) {
      var %locCheck $calc(%xaxis + 1) $+ _ $+ %yaxis
      if ($isalias(%LocCheck)) {
        if ($readini(lastbattle.ini,%u,locks) != westOnly && $readini(lastbattle.ini,%u,locks) != northOnly && $readini(lastbattle.ini,%u,locks) != southOnly && $readini(lastbattle.ini,%u,locks) != east) {
          echo success east 2
          writeini lastbattle.ini %u Xaxis $calc(%xaxis + 1)
          msg $2 $1 moved to the east, current location $readini(lastbattle.ini,%u,Xaxis) $+ , $+ $readini(lastbattle.ini,%u,Yaxis) $+ .
          look $1 $2

          $readini(lastbattle.ini,%u,Xaxis) $+ _ $+ $readini(lastbattle.ini,%u,Yaxis) $1 $2 look
        }
        else {
          msg $2 The path is blocked.
          look $1 $2 Walls
        }
      }
      else {
        look $1 $2 Walls
        msg $2 $calc(%xaxis + 1) is not a valid location. current location $readini(lastbattle.ini,%u,Xaxis) $+ , $+ $readini(lastbattle.ini,%u,Yaxis) $+ .
      }
    }
    if ($3 == West) {
      var %locCheck $calc(%xaxis - 1) $+ _ $+ %yaxis
      if ($isalias(%LocCheck)) {
        if ($readini(lastbattle.ini,%u,locks) != eastOnly && $readini(lastbattle.ini,%u,locks) != northOnly && $readini(lastbattle.ini,%u,locks) != southOnly && $readini(lastbattle.ini,%u,locks) != west) {
          echo success west 2
          writeini lastbattle.ini %u Xaxis $calc(%xaxis - 1)
          msg $2 $1 moved to the west, current location $readini(lastbattle.ini,%u,Xaxis) $+ , $+ $readini(lastbattle.ini,%u,Yaxis) $+ .
          look $1 $2
          $readini(lastbattle.ini,%u,Xaxis) $+ _ $+ $readini(lastbattle.ini,%u,Yaxis) $1 $2 look
        }
        else {
          msg $2 The path is blocked.
          look $1 $2 Walls
        }
      }
      else {
        look $1 $2 Walls
        msg $2 $calc(%xaxis - 1) is not a valid location. current location $readini(lastbattle.ini,%u,Xaxis) $+ , $+ $readini(lastbattle.ini,%u,Yaxis) $+ .
      }
    }
    if ($3 == North) {
      var %locCheck %xaxis $+ _ $+ $calc(%yaxis + 1)
      if ($isalias(%LocCheck)) {
        if ($readini(lastbattle.ini,%u,locks) != eastOnly && $readini(lastbattle.ini,%u,locks) != westOnly && $readini(lastbattle.ini,%u,locks) != southOnly && $readini(lastbattle.ini,%u,locks) != north) {
          writeini lastbattle.ini %u Yaxis $calc(%yaxis + 1)
          msg $2 $1 moved to the North, current location $readini(lastbattle.ini,%u,Xaxis) $+ , $+ $readini(lastbattle.ini,%u,Yaxis) $+ .
          look $1 $2
          $readini(lastbattle.ini,%u,Xaxis) $+ _ $+ $readini(lastbattle.ini,%u,Yaxis) $1 $2 look
        }
        else {
          msg $2 The path is blocked.
          look $1 $2 Walls
        }      
      }
      else {
        look $1 $2 Walls
        msg $2 $calc(%yaxis + 1) is not a valid location. current location $readini(lastbattle.ini,%u,Xaxis) $+ , $+ $readini(lastbattle.ini,%u,Yaxis) $+ .
      }
    }
    if ($3 == South) {
      var %locCheck %xaxis $+ _ $+ $calc(%yaxis - 1)
      if ($isalias(%LocCheck)) {
        if ($readini(lastbattle.ini,%u,locks) != eastOnly && $readini(lastbattle.ini,%u,locks) != northOnly && $readini(lastbattle.ini,%u,locks) != westOnly && $readini(lastbattle.ini,%u,locks) != south) {
          writeini lastbattle.ini %u Yaxis $calc(%yaxis - 1)
          msg $2 $1 moved to the South, current location $readini(lastbattle.ini,%u,Xaxis) $+ , $+ $readini(lastbattle.ini,%u,Yaxis) $+ .
          look $1 $2
          $readini(lastbattle.ini,%u,Xaxis) $+ _ $+ $readini(lastbattle.ini,%u,Yaxis) $1 $2 look
        }
        else {
          msg $2 The path is blocked.
          look $1 $2 Walls
        }      
      }
      else {
        look $1 $2 Walls       
        msg $2 $calc(%yaxis - 1) is not a valid location. current location $readini(lastbattle.ini,%u,Xaxis) $+ , $+ $readini(lastbattle.ini,%u,Yaxis) $+ .
      }
    }
  }
  else {
    msg $2 $1 $+ , all of your movement is cut off! (if you are in battle, you will need to end it first and !disengage after winning)
  }
  if ($3 == look) {
    var %locCheck %xaxis $+ _ $+ %yaxis
    if ($isalias(%LocCheck)) {
      msg $2 Current location $readini(lastbattle.ini,%u,Xaxis) $+ , $+ $readini(lastbattle.ini,%u,Yaxis) $+ .
      look $1 $2
      $readini(lastbattle.ini,%u,Xaxis) $+ _ $+ $readini(lastbattle.ini,%u,Yaxis) $1 $2 look
    }
    else {
      msg $2 location system error encountered: nonexistant location. current location $readini(lastbattle.ini,%u,Xaxis) $+ , $+ $readini(lastbattle.ini,%u,Yaxis) $+ .
    }
  }
  msg $2 location $readini(lastbattle.ini,%u,Xaxis) $+ , $+ $readini(lastbattle.ini,%u,Yaxis)
}

; this subsection for rooms of single player and battle condition rooms last ----------
alias 1_1 {
  echo success
  var %u users_ $+ $1
  if ($3 == examine) {
    if ($4 == trees) {
      look $1 $2 25
    }
    if ($4 == sign) {
      look $1 $2 13
    }
    if ($4 == painting) {
      look $1 $2 21
      if ($readini(lastbattle.ini,%u,IntroStoryArc) == 4) {
        look $1 $2 22
        look $1 $2 23
        look $1 $2 24
        writeini lastbattle.ini %u stones $calc($readini(lastbattle.ini,%u,stones) + 1)
        writeini lastbattle.ini %u IntroStoryArc 5
      }
    }
  }
  if ($3 == visit) {
    if ($4 == building) {
      look $1 $2 8
    }
    if ($4 == LastingImpressions) {
      if ($readini(lastbattle.ini,%u,HairCutStoryArc) == 0) {
        look $1 $2 5
      }
      if ($readini(lastbattle.ini,%u,IntroStoryArc) == 5) {
        look $1 $2 26
        writeini lastbattle.ini %u IntroStoryArc 6
      }
    }
    if ($4 == SmallHouse) {
      look $1 $2 12
      if ($readini(lastbattle.ini,%u,IntroStoryArc) == 2) {
        look $1 $2 18
        writeini lastbattle.ini %u IntroStoryArc 3
      }
    }
    if ($4 == LargeHouse) {
      look $1 $2 10
    }
    if ($4 == FastCuts) {
      look $1 $2 2
    }
  }
  if ($3 == talk) {
    if ($4 == Zack) {
      look $1 $2 6
    }
    if ($4 == Melvin) {
      look $1 $2 3
    }
    if ($4 == SleepingMan) {
      look $1 $2 19
      if ($readini(lastbattle.ini,%u,IntroStoryArc) == 3) {
        look $1 $2 20
        writeini lastbattle.ini %u IntroStoryArc 4
      }
    }

  }
  if ($3 == shop) {
    if ( $4 == LastingImpressions) {
      shop $1 $2 display Lasting_Impressions 4 ExceptionalHaircut 3 HairTonic 1
    }
    if ($4 == FastCuts) {
      shop $1 $2 display Fast_Cuts 2 DecentHaircut 2
    }
  }
  if ($3 == buy) {
    if ($4 == HairTonic) {
      echo success hairtonic 1
      shop $1 $2 buy Lasting_Impressions 2 HairTonic 1

    }
    if ($4 == ExceptionalHaircut) {
      if ($readini(lastbattle.ini,%u,haircutstoryarc) == 0) {
        echo success hairtonic 1
        shop $1 $2 buy Lasting_Impressions 2 ExceptionalHaircut 3
        look $1 $2 7
      }
      else {
        msg $2 Your hair is already cut well.  anymore would be pointless.
      }
    }
    if ($4 == DecentHaircut) {
      if ($readini(lastbattle.ini,%u,HairCutStoryArc) == 0) {
        echo success hairtonic 1
        shop $1 $2 buy Lasting_Impressions 2 DecentHaircut 2
        writeini lastbattle.ini %u HairCutStoryArc 1
        look $1 $2 4
        writeini lastbattle.ini %u int $calc($readini(lastbattle.ini,%u,int) + 1)
      }
      else {
        msg $2 Your hair is already cut well.  Anymore would be pointless.
      }
    }
  }
}

alias 1_2 {
  echo success
  var %u users_ $+ $1
}

alias 1_4 {
  echo success
  var %u users_ $+ $1
}

alias 1_5 {
  echo success
  var %u users_ $+ $1
}

alias 2_1 {
  echo success
  var %u users_ $+ $1
  if ($3 == examine) {
    if ($4 == clearing) {
      if ($readini(lastbattle.ini,%u,1ForrestStoryArc) == 0) {
        look $1 $2 2
      }
      else {
        look $1 $2 3
      }
    }
    if ($4 == redtree) {
      if ($readini(lastbattle.ini,%u,1ForrestStoryArc) == 0) {
        look $1 $2 4
        writeini lastbattle.ini %u 1ForrestStoryArc 1
      }
      if ($readini(lastbattle.ini,%u,1ForrestStoryArc) == 1) {
        look $1 $2 5
      }
      if ($readini(lastbattle.ini,%u,1ForrestStoryArc) == 2) {
        look $1 $2 8
      }
    }
    if ($4 == stone) {
      if ($readini(lastbattle.ini,%u,1ForrestStoryArc) < 2) {
        look $1 $2 6
        writeini lastbattle.ini %u stones $calc($readini(lastbattle.ini,%u,stones) + 1)
        writeini lastbattle.ini %u 1ForrestStoryArc 2
      }
      else {
        look $1 $2 7
      }
    }
  }
}

alias 2_2 {
  echo success
  var %u users_ $+ $1
  if ($3 == advance && $readini(lastbattle.ini,%u,1GuardianStoryArc) != 3) {
    writeini lastbattle.ini %u 1GuardianStoryArc 3
  }
  var %GaurdStoryArc $readini(lastbattle.ini,%u,1GuardianStoryArc)
  if (%GaurdStoryArc == 0) {
    if ($3 == look) { look $1 $2 2 }
    writeini lastbattle.ini %u locks north
  }
  if (%GaurdStoryArc == 3) {
    writeini lastbattle.ini %u locks none
  }
  if ($3 == talk) {
    if ($4 == shadows) {
      if (%GaurdStoryArc == 0) {
        look $1 $2 3
      }
    }
  }
  if ($3 == examine || $3 == visit) {
    if ($4 == shadows) {
      if (%GaurdStoryArc == 0) {
        look $1 $2 4
        if ($readini(lastbattle.ini,%u,engaged) == 1) { disengage $nick $chan }
        if ($readini(lastbattle.ini,%u,life) > 0) {
          writeini lastbattle.ini %u engaged 1
          writeini lastbattle.ini %u locks all
          msg $2 $1 Has engaged the battle.
          writeini lastbattle.ini %u ready 0
          readyTime 5 $1 $2
        }
        if ($readini(lastbattle.ini,%u,life) == 0) {
          msg $2 $1 You have no life, !reset!  To restart the game entirely, just re ~register.
        }
        if ($readini(lastbattle.ini,%u,engaged) == 1) {
          set %userTarget %u
          set %userTargetNick $1
          set %CurrentAI Dark.Being
          set %currentChan $2
          msg $2 $1 is being attacked by Dark.Being!
          writeini lastbattle.ini %u 1GuardianStoryArc 1
          AIspawn
        }
      }
      else {
        look $1 $2 5
      }
    }
  }
}

alias 2_3 {
  echo success
  var %u users_ $+ $1
}

alias 3_4 {
  echo success
  var %u users_ $+ $1
}

alias 4_3 {
  echo success
  var %u users_ $+ $1
}

alias 4_4 {
  echo success
  var %u users_ $+ $1
}

alias 5_1 {
  echo success
  var %u users_ $+ $1
}

alias 5_2 {
  echo success
  var %u users_ $+ $1
}

alias 5_3 {
  echo success
  var %u users_ $+ $1
}

alias 5_4 {
  echo success
  var %u users_ $+ $1
}

; this section for character commands ----------------------------

; this subsection for game option commands ----------

on *:text:!*:#:{
  if ($1 == !register) {
    var %u users_ $+ $nick
    set %StatSet users_ $+ $nick
    registerStats 1
    echo $Chan %StatSet power state is $readini(lastbattle.ini,%u,Ready)
    msg $Chan $nick is registered with $readini(lastbattle.ini,%u,life) life and $readini(lastbattle.ini,%u,energy) energy. Don't know how to play?  Use the !intro or !tutorial command to start the tutorial, and the game.
    showCommands $nick basic
  }
  if ($1 == !disengage) {
    var %u users_ $+ $nick
    if ( $readini(lastbattle.ini,%u,engaged) == 1) {
      disengage $nick $chan
    }
    if $readini(lastbattle.ini,%u,EXP) >= $readini(lastbattle.ini,%u,Level) {
      levelUP $nick $chan
    }   
  }
  if ($1 == !engage) {
    var %u users_ $+ $nick
    if ($readini(lastbattle.ini,%u,engaged) == 1) { disengage $nick $chan }
    if ($readini(lastbattle.ini,%u,life) > 0) {
      var %u users_ $+ $nick
      writeini lastbattle.ini %u engaged 1
      msg $Chan $nick Has engaged the battle.
      writeini lastbattle.ini %u ready 0
      readyTime 5 $nick $chan
    }
    if ($readini(lastbattle.ini,%u,life) == 0) {
      msg $Chan $nick You have no life, !reset!  To restart the game entirely, just re ~register.
    }
  }
  if ($1 == !commands) {
    var %u users_ $+ $nick
    showcommands $nick $2
  }
  if ($1 == !reset) {
    var %u users_ $+ $nick
    if ($readini(lastbattle.ini,%u,engaged) != 1) {
      writeini lastbattle.ini %u life $calc($readini(lastbattle.ini,%u,lifeCap) - 10)
      writeini lastbattle.ini %u energy $calc($readini(lastbattle.ini,%u,energyCap) - 10)
      timer $+ $nick 0 10 writeini lastbattle.ini %u Ready 1
      msg $Chan $nick powered on $readini(lastbattle.ini,%u,Ready)
      msg $Chan $nick is reset to $readini(lastbattle.ini,%u,life) life.
    }
  }
  if ($1 == !intro || $1 == !tutorial ) {
    var %u users_ $+ $nick
    if ($readini(lastbattle.ini,%u,IntroStoryArc) == 0) {
      look $nick $chan 14
      look $nick $chan 15
      look $nick $chan 16
      writeini lastbattle.ini %u IntroStoryArc 1
    }
  }
  echo hi
}

; this subsection for non battle commands ----------

on *:text:,*:#:{
  var %u users_ $+ $nick
  var %i users_ $+ $2
  if ($1 == ,disengage) {
    var %u users_ $+ $nick
    if ( $readini(lastbattle.ini,%u,engaged) == 1) {
      disengage $nick $chan
    }
    if $readini(lastbattle.ini,%u,EXP) >= $readini(lastbattle.ini,%u,Level) {
      levelUP $nick $chan
    }
  }
  if ($1 == ,engage) {
    var %u users_ $+ $nick
    if ($readini(lastbattle.ini,%u,engaged) == 1) { disengage $nick $chan }
    if ($readini(lastbattle.ini,%u,life) > 0) {
      var %u users_ $+ $nick
      writeini lastbattle.ini %u engaged 1
      msg $Chan $nick Has engaged the battle.
      writeini lastbattle.ini %u ready 0
      readyTime 5 $nick $chan
    }
  }
  if ($1 == ,move) {
    PlayerLocation $nick $chan $2
  }
  if ($1 == ,look) {
    echo looking
    PlayerLocation $nick $chan look
    if ($readini(lastbattle.ini,%u,IntroStoryArc) == 1) {
      look $nick $chan 17
      writeini lastbattle.ini %u IntroStoryArc 2
    }
  }
  if ($1 == ,visit) {
    var %tat $2
    if ($3 != $null) {
      var %tat $2 $+ $3
    }
    $readini(lastbattle.ini,%u,Xaxis) $+ _ $+ $readini(lastbattle.ini,%u,Yaxis) $nick $chan visit %tat
  }
  if ($1 == ,examine) {
    var %tat $2
    if ($3 != $null) {
      var %tat $2 $+ $3
    }
    $readini(lastbattle.ini,%u,Xaxis) $+ _ $+ $readini(lastbattle.ini,%u,Yaxis) $nick $chan examine %tat
  }
  if ($1 == ,talk && $2 == to) {
    var %tat $3
    if ($4 != $null) {
      var %tat $3 $+ $4
    }
    $readini(lastbattle.ini,%u,Xaxis) $+ _ $+ $readini(lastbattle.ini,%u,Yaxis) $nick $chan talk %tat
  }
  var %tat $2
  if ($3 != $null) {
    var %tat $2 $+ $3
  }
  if ($1 == ,shop) {
    $readini(lastbattle.ini,%u,Xaxis) $+ _ $+ $readini(lastbattle.ini,%u,Yaxis) $nick $chan shop %tat
  }
  if ($1 == ,buy) {
    $readini(lastbattle.ini,%u,Xaxis) $+ _ $+ $readini(lastbattle.ini,%u,Yaxis) $nick $chan buy %tat
  }
}

; this subsection for all attacks and battle commands ----------

on *:text:.*:#:{
  var %u users_ $+ $nick
  var %i users_ $+ $2
  haltChecks $nick $chan
  if ($2 != $null) {
    haltChecks2 $2 $chan
  } 
  if ($statusAilment($nick,$chan)) {
    if ($2 != $null) {   
      if ($1 == .attack) {
        if ($energyCostOrGain($nick,$readini(lastbattle.ini,%u,rec),$chan)) {
          $damageCalc($2,$DDif(%u,%i,$calc(4 + $rand(0,3))),8,$nick,$chan)
        }
      }
      if ($1 == .jumpkick) {
        jumpkick $nick $chan $2
      }
      if ($1 == .shockwave) {
        shockwave $nick $chan $2
      }  
      if ($1 == .focuspunch) {
        focuspunch $nick $chan $2
      }
      if ($1 == .slash) {
        slash $nick $chan $2
      }
      if ($1 == .poisonstrike) {
        poisonstrike $nick $chan $2
      }
    }
    if ($1 == .recover) {
      if ($readini(lastbattle.ini,%u,level) > 0) {
        var %x = $calc($readini(lastbattle.ini,%u,energy) + 6 + $readini(lastbattle.ini,%u,rec))
        var %y = $calc($readini(lastbattle.ini,%u,life) + 1)
        writeini lastbattle.ini %u life %y
        writeini lastbattle.ini %u energy %x
        checkCaps $nick $chan
        If ($readini(lastbattle.ini,%u,life) < $readini(lastbattle.ini,%u,lifeCap) && $readini(lastbattle.ini,%u,energy) < $readini(lastbattle.ini,%u,energyCap)) { 
          msg $Chan $nick $+ 's energy rises by $calc(3 + $readini(lastbattle.ini,%u,rec)) and gains 1 life 
        }
        else { 
          if ($readini(lastbattle.ini,%u,life) >= $readini(lastbattle.ini,%u,lifeCap)) { msg $Chan $nick $+ 's life is MAXED }
          if ($readini(lastbattle.ini,%u,energy) >= $readini(lastbattle.ini,%u,energyCap)) { msg $Chan $nick $+ 's Energy is MAXED }
        }
        msg $Chan $nick has $readini(lastbattle.ini,%u,life) life remaining.
        msg $Chan $nick has $readini(lastbattle.ini,%u,energy) energy remaining.
        writeini lastbattle.ini %u Ready 0
        readyTime 5 $nick $chan
      }
    }
    if ($1 == .heal) {
      if ($readini(lastbattle.ini,%u,level) > 2) {
        var %x = $calc($readini(lastbattle.ini,%u,energy) + 1)
        var %y = $calc($readini(lastbattle.ini,%u,life) + 10)
        writeini lastbattle.ini %u life %y
        writeini lastbattle.ini %u energy %x
        checkCaps $nick $chan
        If ($readini(lastbattle.ini,%u,life) < $readini(lastbattle.ini,%u,lifeCap) && $readini(lastbattle.ini,%u,energy) < $readini(lastbattle.ini,%u,energyCap)) { 
          msg $Chan $nick $+ 's energy rises by 1 and gains 10 life 
        }
        else { 
          if ($readini(lastbattle.ini,%u,life) >= $readini(lastbattle.ini,%u,lifeCap)) { msg $Chan $nick $+ 's life is MAXED }
          if ($readini(lastbattle.ini,%u,energy) >= $readini(lastbattle.ini,%u,energyCap)) { msg $Chan $nick $+ 's Energy is MAXED }
        }
      }
      msg $Chan $nick has $readini(lastbattle.ini,%u,life) life remaining.
      msg $Chan $nick has $readini(lastbattle.ini,%u,energy) energy remaining.
      writeini lastbattle.ini %u Ready 0
      readyTime 5 $nick $chan
    }
  }
}

; this section for Developer Commands and unsorted ----------------------------

on *:text:~*:#:{
  if ($1 == ~trainOne) {
    var %u users_ $+ $nick
    if ($readini(lastbattle.ini,%u,engaged) == 1) {
      set %userTarget %u
      set %userTargetNick $nick
      set %CurrentAI Dark.Being
      set %currentChan $chan
      msg $Chan $nick launched AI
      AIspawn
    }
  }
  if ($1 == ~powershow) {
    var %u users_ $+ $nick
    msg $Chan $nick $readini(lastbattle.ini,%u,Ready)
    writeini lastbattle.ini %u Ready 0
    msg $Chan $nick $readini(lastbattle.ini,%u,Ready)
  }
  if ($1 == ~status) {
    var %u users_ $+ $2
    var %nick $2
    if ($2 == $null) { 
      var %u users_ $+ $nick
      var %nick $nick
    }
    msg $Chan %nick DIAGNOSTIC USE ONLY
    msg $Chan %nick has $readini(lastbattle.ini,%u,life) life remaining.
    msg $Chan %nick has $readini(lastbattle.ini,%u,energy) energy remaining.
    msg $Chan %nick 's engaged value is $readini(lastbattle.ini,%u,engaged)
    msg $Chan %nick has $readini(lastbattle.ini,%u,EXP) EXP unused.
    msg $Chan %nick is at level $readini(lastbattle.ini,%u,Level).
    msg $Chan %nick is at attack $readini(lastbattle.ini,%u,atk).
    msg $Chan %nick is at def $readini(lastbattle.ini,%u,def).
  }
}

alias ShowMap1 {
  msg $active 1,1(~)1,1(~)1,1(~)1,1(~)1,1(~)1,1(~)1,1(~)
  msg $active 2,2(~)3,0(#)0,0(~)4,0(~)0,0(~)1,1(~)1,1(~)
  msg $active 2,2(~)0,2(^)0,0(~)5,5(~)0,0(~)0,0(~)1,1(~)
  msg $active 2,2(~)2,2(~)5,5[0,0#5,5]5,4(~)5,5(~)4,0(~)1,1(~)
  msg $active 2,2[~]0,7[#]4,0(~)5,5(~)1,1(~)3,0(~)1,1(~)
  msg $active 1,1[~]7,0(^)0,3[#]1,1(~)1,1(~)0,0(~)4,1(#)
  msg $active 1,1(~)1,1(~)1,1(~)1,1(~)1,1(~)1,1(~)1,1(~)
}

Comments

Sign in to comment.
Arigateaux   -  Nov 05, 2011

I sent you a PM. Did you get it?

 Respond  
extio   -  Nov 04, 2011

ok guys, to make the shop menu, i decided to use an identifier that is dynamic.

alias testone {
testtwo itworksifitusesthefirstone 1
}

alias testtwo {
var %x $2 ; <- here we say use the second one, should be a one.
var %combined $ $+ %x ; <- so that one directs it to the first one.
var %combined2 . [ [ %combined ] ]
echo %combined2 hi
}

and this works, unless, you take out the period. then the text is just oddly colored. ... why? ... anyways so the shop menu, im working on that. then invintory, then a way to keep track of progress through the singe player story arcs.

 Respond  
extio   -  Oct 27, 2011

an option then i will keep in mind. for now i dont want to make them have picwins to see the map, so im just going to have "maps" you can pick up or buy in the game, and it shows a representation of everything. currently an example is at the bottom of the code.

 Respond  
Arigateaux   -  Oct 27, 2011

Picwins can do this, as long as the player has a script to read from the bot and transform it into a picwin.

 Respond  
extio   -  Oct 26, 2011

as an unexpected side effect... reducing the number of ontext significantly increased the speed of the battle processing. that and i now turn off flood protection for the channel im using. using a designated channel. now works much better....

i cant have a flood protection, it sends too much stuff. i have flood protection on mirc option list set to 500 bytes though.... and like 20 lines. also strips color codes on incoming.

 Respond  
Dani_l11   -  Sep 23, 2011

Ah right, didn't know that was the case, thought it was some kind of single player rpg ;-)

Make sure to add a flood protection, so you will not excess flood!

 Respond  
extio   -  Sep 23, 2011

its a game you play with a bot hosting the code, the picture needs to come through irc?? i dont think picwin (and i couldnt find it to get it anyways) can do that?

this game is like zork, only .. multiplayer... with action based battles... and co-op.... and online.... the map will have to show up in the channel.

 Respond  
Dani_l11   -  Sep 22, 2011

also, considering using mirc ascii art to draw a map for single player for each area... a pain but doable...

Please go use picwins!

 Respond  
extio   -  Sep 22, 2011

actually i should probably group the like commands and aliases better to keep track... the exit / leave thing is just in there while im testing it so it doesnt matter much. its just so i can make it leave without going into mirc since my regular client is icechat. also im new to mirc script cause in icechat i used vbscript ... so im just using the easiest commands i can find.

 Respond  
Jethro   -  Sep 17, 2011

Never mind. I overlooked that. :p Also, using $iif() is limited because if you happen to have more commands to add under an if condition, you're gonna be in hot water. I wouldn't go for the goto with $iif() either.

 Respond  
Jethro   -  Sep 17, 2011

It's more efficient doing it like so:

on $*:TEXT:^!(exit|leave)$:#:{
 var %1 = $regml(1)
 if (%1 == exit) quit lastbattlescript, requested.
 else %1 # lastbattle
}

In case you don't know. The command /leave is a deprecated command (yes, it still works) for /part command. They work exactly the same.

 Respond  
Frenetic   -  Sep 17, 2011

Dani_l11, yeah his script his rules, I guess.

 Respond  
Dani_l11   -  Sep 17, 2011

Lol that shouldn't even be in there. You can now make everyone with that script leave/quit.

Also. The use of that on text will screw up the rest of your script. You should use

on $*:TEXT:^!(exit|leave)$:#:{
$iif($regml(1) == exit,quit,part #) LastBattleScript, Requested
}

Ask jethro, i'm sure he will agree with me. He likes $regml(1) a lot aswell! :D

 Respond  
Frenetic   -  Sep 17, 2011

My command? lolwut

 Respond  
Frenetic   -  Sep 17, 2011
on *:text:!exit:#:{
  /quit LastBattleScript, Requested
  /part $chan LastBattleScript, Requested
}
on *:text:!leave:#:{
  /part $chan lastbattle
}
on *:text:*:#:{ 
if ($1 = !exit) { quit LastBattleScript, Requested } 
if ($1 = !leave) { part $chan lastbattle }
} 
 Respond  
Dani_l11   -  Sep 17, 2011

Oh i thought this was Worms -.- after reading Frenetic' command, sad....

 Respond  
Frenetic   -  Sep 17, 2011

I see.

 Respond  
Jethro   -  Sep 16, 2011

Yes and caterpillars are worm-like creatures before they grow into a butterfly and fly up to the sky.

 Respond  
Frenetic   -  Sep 16, 2011

WTF? I thought worms did ...

 Respond  
Jethro   -  Sep 16, 2011

Frenetic, the mother nature is an amazing thing. Look at how a little caterpillar turns into a butterfly!

 Respond  
Frenetic   -  Sep 16, 2011

You go from an Auto-away, one to an RPG? wtf

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.