View Single Post
  #21  
Old 07-24-2008, 08:10 PM
TheStan TheStan is offline
Stan?
Join Date: May 2008
Location: U.S.
Posts: 100
TheStan is on a distinguished road
Send a message via AIM to TheStan Send a message via MSN to TheStan
PHP Code:
public function changeStatBase(objectstatval) {
  if (!(
stat in {"health""stamina"})) {
    
this.error(null"Stat (#s) is not in the required stat list!"stat);
    return;
  }
  
object.(@ stat)[BASE] += val;
  echo(
"STAT BASE: " object.(@ stat));
}
public function 
changeStatCurrent(objectstatval) {
  if (!(
stat in {"health""stamina"})) {
    
this.error(null"Stat (#s) is not in the required stat list!"stat);
    return;
  }
  
object.(@ stat)[CURRENT] += val;
  if (
object.(@ stat)[CURRENT] > object.(@ stat)[TOTAL]) {
    
object.(@ stat)[CURRENT] = object.(@ stat)[TOTAL];
  }
  else if (
object.(@ stat)[CURRENT] < object.(@ stat)[MIN]) {
    
object.(@ stat)[CURRENT] = object.(@ stat)[MIN];
  }
  echo(
"STAT CURRENT: " object.(@ stat));

Percent signs once again replaced with "#" signs.

These are my basic system functions for stat changing for example if someone were to do some damage this is where I go to reduce or increase health or another listed stat etc.
Reply With Quote