All pastes #344261 Raw Edit

dm eat

public text v1 · immutable
·published 2007-02-07 17:22 UTC
rendered paste body
on *:text:!eat:#:{ 
  if (%dm != ON) { 
    notice $nick %dm.color $+ There is no DM active. 
    halt 
  } 
  if ($nick != %dm.attacker) { notice $nick It's not your turn noob! | halt } 
  if ($nick == %dm.starter) { 
    if (%dm.starter.food == 0) { notice $nick You have no more food! | goto three } 
    inc %dm.starter.health %dm.food 
    dec %dm.starter.food  
    goto two 
  } 
  if ($nick == %dm.opponent) { 
    if (%dm.opponent.food == 0) { notice $nick You have no more food! | goto three } 
    inc %dm.opponent.health %dm.food 
    dec %dm.starter.food 
    goto two 
  } 
  :two 
  if (%dm.starter.health > 99) { set %dm.starter.health 99 } 
  if (%dm.opponent.health > 99) { set %dm.opponent.health 99 } 
  if ($nick == %dm.starter) { 
    msg $chan %dm.color $+ %dm.starter eats the food. He now has %dm.starter.health health remaining and %dm.starter.food food left! 
    msg $chan %dm.color $+ Go ahead, %dm.opponent take a shot! 
    set %dm.attacker %dm.opponent 
    halt 
  } 
  if ($nick == %dm.opponent) { 
    msg $chan %dm.color $+ %dm.opponent eats the food. He now has %dm.opponent.health health remaining and %dm.opponent.food food left! 
    msg $chan %dm.color $+ Go ahead, %dm.starter take a shot! 
    set %dm.attacker %dm.starter 
    halt 
    :three 
    if (%dm.attacker == %dm.starter) { 
      msg $chan %dm.starter has no more food left! 
      set %dm.attacker %dm.opponent 
      msg $chan Go ahead, %dm.opponent - defeat him! 
      halt 
    } 
    if (%dm.attacker == %dm.opponent) { 
      msg $chan %dm.opponent has no more food left! 
      set %dm.attacker %dm.starter 
      msg $chan Go ahead, %dm.starter - defeat him! 
      halt 
    } 
  } 
}