Mirc Player Tracker
dialog seed_tracker {
  title "SeeD Player Tracker"
  size -1 -1 237 224
  option dbu
  box "Armor Modifiers", 41, 176 52 56 23
  edit "", 1, 60 17 50 10, center
  edit "", 2, 120 17 50 10, center
  edit "", 3, 60 39 50 10, center
  edit "", 4, 120 39 50 10, center
  edit "", 7, 120 61 50 10, center
  edit "", 8, 120 84 50 10, center
  edit "", 5, 60 61 50 10, center
  edit "#", 6, 60 84 50 10
  button "Physical Damage", 9, 5 5 46 12
  button "Magical Damage", 10, 5 17 46 12
  button "Healing", 11, 5 30 46 12
  button "Cast", 13, 5 43 46 12
  button "MP Recovery", 12, 5 56 46 12
  button "Post", 14, 5 80 46 12
  check "Bubble", 15, 180 41 41 10
  check "MP Damage", 17, 180 23 40 10
  check "Piercing Damage", 21, 179 62 50 10
  button "Poison", 22, 5 68 46 12
  button "Regen", 23, 5 95 34 17
  edit "", 24, 212 5 19 10, center
  edit "", 25, 40 103 18 10, center
  button "Refresh", 26, 61 96 34 17
  edit "", 27, 96 104 18 10, center
  button "Gravity", 28, 116 96 34 17
  edit "", 29, 153 104 18 10, center
  edit "", 30, 118 116 55 10
  text "Current HP", 32, 70 6 39 8
  text "Max HP", 33, 132 6 20 8
  text "Current MP", 34, 70 28 29 8
  text "Max MP", 35, 130 28 25 8
  text "Damage", 36, 73 50 25 8
  text "Channel", 37, 71 73 25 8
  text "Armor", 38, 131 50 25 8
  text "M.Armor", 39, 129 73 25 8
  box "Defense Modifiers", 40, 176 76 56 49
  box "HP Modifiers", 42, 177 15 56 37
  text "Character Tier", 43, 177 6 36 8
  text "VIT", 44, 44 95 11 8
  text "SPR", 45, 99 96 11 8
  text "%", 46, 158 96 9 8
  text "Post-Armor Damage", 47, 69 117 52 8
  button "End Of Turn", 48, 5 114 57 12
  edit "", 49, 15 148 50 10
  edit "", 61, 70 148 15 10, center
  edit "", 50, 15 158 50 10
  edit "", 62, 70 158 15 10, center
  edit "", 51, 15 168 50 10
  edit "", 63, 70 168 15 10, center
  edit "", 52, 15 178 50 10
  edit "", 64, 70 178 15 10, center
  edit "", 53, 15 188 50 10
  edit "", 65, 70 188 15 10, center
  edit "", 54, 15 198 50 10
  edit "", 66, 70 198 15 10, center
  edit "", 55, 113 148 50 10
  edit "", 67, 168 148 15 10, center
  edit "", 56, 113 158 50 10
  edit "", 68, 168 158 15 10, center
  edit "", 57, 113 168 50 10
  edit "", 69, 168 168 15 10, center
  edit "", 58, 113 178 50 10
  edit "", 70, 168 178 15 10, center
  edit "", 59, 113 188 50 10
  edit "", 71, 168 188 15 10, center
  edit "", 60, 113 198 50 10
  edit "", 72, 168 198 15 10, center
  box "Status Effects", 80, 3 130 228 89
  text "Status", 81, 32 139 25 8
  text "Dur.", 82, 74 139 11 8
  text "Status", 83, 130 139 25 8
  text "Dur.", 84, 170 139 12 8
  button "Winning Streak /Extend", 85, 188 142 39 32, multi
  check "Element Absorb", 86, 180 32 50 10
  edit "", 31, 83 209 56 10
  text "Stoneskin", 87, 58 209 24 8
  radio "5/5th", 100, 180 83 50 8
  radio "4/5ths", 101, 180 91 50 8
  radio "3/5ths", 102, 180 99 50 8
  radio "2/5ths", 103, 180 107 50 8
  radio "1/5ths", 104, 180 115 50 8
  button "Boon", 18, 188 175 39 32, multi
  menu "Menu", 91
  item "End Battle", 90, 91
  item "Open", 89, 91
  item "Save", 88, 91
}

alias seedtracker {
  dialog -md seed_tracker seed_tracker
  seedload
}

alias seedsave {
  if ($did(seed_tracker,1) != $null) { writeini seedchar.ini $me currhp $did(seed_tracker,1) }
  if ($did(seed_tracker,2) != $null) { writeini seedchar.ini $me maxhp $did(seed_tracker,2) }
  if ($did(seed_tracker,3) != $null) { writeini seedchar.ini $me currmp $did(seed_tracker,3) }
  if ($did(seed_tracker,4) != $null) { writeini seedchar.ini $me maxmp $did(seed_tracker,4) }
  if ($did(seed_tracker,6) != $null) { writeini seedchar.ini $me chan $did(seed_tracker,6) }
  if ($did(seed_tracker,7) != $null) { writeini seedchar.ini $me arm $did(seed_tracker,7) }
  if ($did(seed_tracker,8) != $null) { writeini seedchar.ini $me marm $did(seed_tracker,8) }
  if ($did(seed_tracker,24) != $null) { writeini seedchar.ini $me tier $did(seed_tracker,24) }
  if ($did(seed_tracker,25) != $null) { writeini seedchar.ini $me vit $did(seed_tracker,25) }
  if ($did(seed_tracker,27) != $null) { writeini seedchar.ini $me spr $did(seed_tracker,27) }
}

alias seedload {
  /did -o seed_tracker 1 1 $readini(seedchar.ini,$me,currhp)
  /did -o seed_tracker 2 1 $readini(seedchar.ini,$me,maxhp)
  /did -o seed_tracker 3 1 $readini(seedchar.ini,$me,currmp)
  /did -o seed_tracker 4 1 $readini(seedchar.ini,$me,maxmp)
  /did -o seed_tracker 6 1 $readini(seedchar.ini,$me,chan)
  /did -o seed_tracker 7 1 $readini(seedchar.ini,$me,arm)
  /did -o seed_tracker 8 1 $readini(seedchar.ini,$me,marm)
  /did -o seed_tracker 24 1 $readini(seedchar.ini,$me,tier)
  /did -o seed_tracker 25 1 $readini(seedchar.ini,$me,vit)
  /did -o seed_tracker 27 1 $readini(seedchar.ini,$me,spr)
}

alias maxhp {
  if ($did(seed_tracker,15).state) { return $calc($did(seed_tracker,2)*2) }
  else { return $did(seed_tracker,2) }
}

alias sarmor {
  if ($did(seed_tracker,21).state) { return 0 }
  return $calc($did(seed_tracker,7) + %armmod)
}

alias smarmor {
  if ($did(seed_tracker,21).state) { return 0 }
  return $calc($did(seed_tracker,8) + %marmmod)
}

alias sdamage {
  var %damage = $1
  if ($did(seed_tracker,17).state) { 
    if (%damage >= $did(seed_tracker,3)) { did -o seed_tracker 3 1 0 | var %fdam = 1 }
    else { did -o seed_tracker 3 1 $calc($did(seed_tracker,3) - %damage) | var %fdam = %damage }
  }
  else {
    if (%damage >= $did(seed_tracker,1)) { did -o seed_tracker 1 1 0 | var %fdam = 1 }
    else { did -o seed_tracker 1 1 $calc($did(seed_tracker,1) - %damage) | var %fdam = %damage }
  }
  did -o seed_tracker 30 1 %fdam
}

alias sheal {
  var %heal = $2
  if ($1 == 1) {
    if ($calc(%heal + $did(seed_tracker,1)) >= $maxhp) { did -o seed_tracker 1 1 $maxhp }
    else { did -o seed_tracker 1 1 $calc(%heal + $did(seed_tracker,1)) }
  }
  else {
    if ($calc(%heal + $did(seed_tracker,3)) >= $did(seed_tracker,4)) { did -o seed_tracker 3 1 $did(seed_tracker,4) }
    else { did -o seed_tracker 3 1 $calc(%heal + $did(seed_tracker,3)) }
  }
  ; Usage: heal <HP:1/MP:2>
}

on *:dialog:seed_tracker:sclick:15: {
  ; Bubble Ticker
  if ($did(seed_tracker,15).state) { did -o seed_tracker 1 1 $int($calc($did(seed_tracker,1) * 2)) }
  else { did -o seed_tracker 1 1 $int($calc($did(seed_tracker,1) / 2)) }
}

on *:dialog:seed_tracker:sclick:9: {
  ; Physical Damage button
  if ($did(seed_tracker,100).state) { var %defend = 1 }
  elseif ($did(seed_tracker,101).state) { var %defend = 0.8 }
  elseif ($did(seed_tracker,102).state) { var %defend = 0.6 }
  elseif ($did(seed_tracker,103).state) { var %defend = 0.4 }
  elseif ($did(seed_tracker,104).state) { var %defend = 0.2 }
  else { var %defend = 1 }
  var %damage = $int($calc(($did(seed_tracker,5) - $sarmor) * %defend))
  if (%damage <= 0) { var %damage = 1 }
  if ($did(seed_tracker,31) > 0) && ($did(seed_tracker,31) isnum) {
    ;Stoneskin Damage
    if (%damage <= $did(seed_tracker,31)) {
      did -o seed_tracker 31 1 $calc($did(seed_tracker,31) - %damage)
      var %damage = 0
    }
    else {
      var %damage = $calc( %damage - $did(seed_tracker,31) )
      did -o seed_tracker 31 1 0
    }
  }
  if ($did(seed_tracker,86).state) { sheal 1 $int(%damage) }
  else { sdamage $int(%damage) }
}

on *:dialog:seed_tracker:sclick:10: {
  ; Magical Damage button
  if ($did(seed_tracker,100).state) { var %defend = 1 }
  elseif ($did(seed_tracker,101).state) { var %defend = 0.8 }
  elseif ($did(seed_tracker,102).state) { var %defend = 0.6 }
  elseif ($did(seed_tracker,103).state) { var %defend = 0.4 }
  elseif ($did(seed_tracker,104).state) { var %defend = 0.2 }
  else { var %defend = 1 }
  var %damage = $int($calc(($did(seed_tracker,5) - $smarmor) * %defend))
  if (%damage <= 0) { var %damage = 1 }
  if ($did(seed_tracker,31) > 0) && ($did(seed_tracker,31) isnum) {
    ;Stoneskin Damage
    if (%damage <= $did(seed_tracker,31)) {
      did -o seed_tracker 31 1 $calc($did(seed_tracker,31) - %damage)
      var %damage = 0
    }
    else {
      var %damage = $calc( %damage - $did(seed_tracker,31) )
      did -o seed_tracker 31 1 0
    }
  }
  if ($did(seed_tracker,86).state) { sheal 1 $int(%damage) }
  else { sdamage $int(%damage) }
}

on *:dialog:seed_tracker:sclick:11: {
  ; Healing button
  sheal 1 $did(seed_tracker,5)
}

on *:dialog:seed_tracker:sclick:13 {
  ; Spellcast button
  if ($did(seed_tracker,5) > $did(seed_tracker,3)) { msg $me MP cost exceeds current MP, cannot cast }
  else { did -o seed_tracker 3 1 $calc($did(seed_tracker,3) - $did(seed_tracker,5)) }
}

on *:dialog:seed_tracker:sclick:12: {
  ; MP Recovery button
  sheal 2 $did(seed_tracker,5)
}

on *:dialog:seed_tracker:sclick:22 {
  ; Poison button
  sdamage $int($calc($did(seed_tracker,1) * 0.2))
}

on *:dialog:seed_tracker:sclick:23: {
  ; Regen button
  sheal 1 $calc($did(seed_tracker,25) * 4 * $did(seed_tracker,24)) 
}

on *:dialog:seed_tracker:sclick:26: {
  ; Refresh button
  sheal 2 $calc($did(seed_tracker,27) * ($did(seed_tracker,24) + 1))
}

on *:dialog:seed_tracker:sclick:28: {
  ; Gravity button
  if ($did(seed_tracker,17).state) {
    var %damage = $calc($did(seed_tracker,3) * ($did(seed_tracker,29)/100))
    if (%damage >= $did(seed_tracker,3)) { var %damage = 0 }
  }
  else {
    var %damage = $calc($did(seed_tracker,1) * ($did(seed_tracker,29)/100))
    if (%damage >= $did(seed_tracker,1)) { var %damage = 0 }
  }
  sdamage $int(%damage)
}

; Status Tracker
on *:dialog:seed_tracker:sclick:48: {
  ; End of Turn
  var %currstatus = 1
  while (%currstatus <= 12) {
    var %currtimer = $calc(%currstatus + 60)
    if ($did(seed_tracker, $+ %currtimer $+) isnum) && ($did(seed_tracker, $+ %currtimer $+) > 0) {
      did -o seed_tracker %currtimer 1 $calc($did(seed_tracker, $+ %currtimer $+) - 1)
    }
    inc %currstatus
  }
}

on *:dialog:seed_tracker:sclick:85: {
  ; Winning Streak button
  var %currstatus = 1
  while (%currstatus <= 12) {
    var %currtimer = $calc(%currstatus + 60)
    if ($did(seed_tracker, $+ %currtimer $+) isnum) && ($did(seed_tracker, $+ %currtimer $+) > 0) {
      did -o seed_tracker %currtimer 1 $calc($did(seed_tracker, $+ %currtimer $+) + 2)
    }
    inc %currstatus
  }
}

on *:dialog:seed_tracker:sclick:18: {
  ; Boon button
  var %currstatus = 1
  var %boonlist = Accuracy Up.Bar-Fire.Bar-Ice.Bar-Lightning.Bar-Water.Bar-Holy.Bar-Shadow.Bar-Element.Blink.Bravery.Bubble.Critical Up.Dread Spikes.En-Fire.En-Ice.En-Lightning.En-Holy.En-Shadow.En-Water.Fire Sword.Ice Sword.Lightning Sword.Water Sword.Holy Sword.Dark Sword.Element Sword.Lethargy Sword.Slow Sword.Zombie Sword.Sap Sword.Stun Sword.Sleep Sword.Flare Sword.Drain Sword.Osmoses Sword.Other Sword.Evasion Up.Faith.Float.Haste.Protect.Reflect.Refresh.Regen.Resist.Shell.Tranq.Vanish.Veil.Vigilance
  while (%currstatus <= 12) {
    var %currtimer = $calc(%currstatus + 60)
    var %currname = $calc(%currstatus + 48)
    if ($did(seed_tracker, $+ %currtimer $+) isnum) && ($did(seed_tracker, $+ %currtimer $+) > 0) && ($istok(%boonlist,$did(seed_tracker, $+ %currname $+),46) == $true) {
      did -o seed_tracker %currtimer 1 $calc($did(seed_tracker, $+ %currtimer $+) + 1)
    }
    inc %currstatus
  }
}

alias boonlist {
  ; Token separator is . or 46
  var %boonlist = Accuracy Up.Bar-Fire.Bar-Ice.Bar-Lightning.Bar-Water.Bar-Holy.Bar-Shadow.Bar-Element.Blink.Bravery.Brave.Bubble.Critical Up.Dread Spikes.En-Fire.En-Ice.En-Lightning.En-Holy.En-Shadow.En-Water.Fire Sword.Ice Sword.Lightning Sword.Water Sword.Holy Sword.Dark Sword.Element Sword.Lethargy Sword.Slow Sword.Zombie Sword.Sap Sword.Stun Sword.Sleep Sword.Flare Sword.Drain Sword.Osmoses Sword.Other Sword.Evasion Up.Faith.Float.Haste.Protect.Reflect.Refresh.Regen.Resist.Shell.Tranq.Vanish.Veil.Vigilance
  var %boon = $sorttok(%boonlist,46)
  echo $me Boon-supported statuses: $replace(%boon,.,$chr(32) $+ - $+ $chr(32))
}

; End of status tracker

on *:dialog:seed_tracker:menu:89: {
  ; Character Open
  seedload
}

on *:dialog:seed_tracker:menu:88: {
  ; Character Save
  seedsave
}

on *:dialog:seed_tracker:menu:90: {
  ; Battle End (Clear Status, Save Character)
  var %currstatus = 1
  while (%currstatus <= 8) {
    var %currtimer = $calc(%currstatus + 48)
    var %currname = $calc(%currstatus + 56)
    did -o seed_tracker %currtimer 1 $null
    did -o seed_tracker %currname 1 $null
    inc %currstatus
  }
  seedsave
}

on *:dialog:seed_tracker:sclick:14: {
  ; Post button
  if ($did(seed_tracker,1) <= $calc($maxhp / 10)) { var %color = 4 }
  elseif ($did(seed_tracker,1) <= $calc($maxhp / 4)) { var %color = 7 }
  else { var %color = $null }
  if ($did(seed_tracker,31) > 0) { var %ssline = SS: $chr(91) $+ $did(seed_tracker,31) $+ $chr(93) }
  var %hpline = HP: $+ %color $did(seed_tracker,1) $+ / $+ $maxhp
  var %mpline = MP: $+ $chr(32) $+ $did(seed_tracker,3) $+ / $+ $did(seed_tracker,4)
  var %sos = SoS: $int($calc($maxhp / 4))
  var %currstatus = 1
  while (%currstatus <= 12) {
    ; Status line generator 
    var %currtimer = $calc(%currstatus + 60)
    var %currname = $calc(%currstatus + 48)
    if ($did(seed_tracker, $+ %currname $+ ) != 0) && ($did(seed_tracker, $+ %currname $+ ) != $null) {
      var %statusline = $addtok(%statusline,$did(seed_tracker, $+ %currname $+ ) ( $+ $did(seed_tracker, $+ %currtimer $+ ) $+ ),44)
    }
    inc %currstatus
  }
  if (%statusline == $null) { var %spacer = $null }
  else { var %spacer = $chr(32) - $chr(32) }
  if ($did(seed_tracker,31) > 0) { var %spacer2 = $chr(32) }
  else { var %spacer2 = $null }
  msg $did(seed_tracker,6) (( $+ %ssline $+ %spacer2 $+ %hpline $+ , %mpline $+ , %sos $+ %spacer $+ %statusline $+ ))
}
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License