View Single Post
  #1  
Old 01-24-2009, 06:17 AM
Novice Novice is offline
Developer
Join Date: Dec 2008
Posts: 90
Novice is an unknown quantity at this point
Send a message via MSN to Novice
Help with projectiles (again)

I'm trying to set up N-Pulse Rebirth's spell system so that it checks for if the projectile is hitting a baddy.
I have no clue how to go about doing this, but getting it to hit players works perfectly.
I'm only going to give all the shooting param stuff that works for players, but not baddies.

In the main Spell system:
PHP Code:
function onActionServersidecmdp1 ) {
  switch ( 
cmd ) {
    case 
"Attack":
      
triggerclient("gui","-System/Health","Attacked",player.x,player.y,p1,player.account);
    break;
  }
}
//#CLIENTSIDE
//a bunch of spell loads here\\

function onCast() {
  
//mp and cooldown checks here\\
      
setShootParams(this.spell_effect,this.spell_power,this.spell_bonus);
      
this.spell_angle getangle(vecx(player.dir),vecy(player.dir));
      
shoot(player.x+vecx(player.dir), player.y+vecy(player.dir), player.zthis.spell_angle10this.spell_shootaninull);
  
//some more checking\\
}

function 
onActionProjectileeffectpowerbonus ) {
  switch ( 
effect ) {
    
    case 
"Hurt":
   
//hurt loads\\
      
triggerserver("gui",this.name,"Attack",temp.hpower);
    break;
  }

All of that works for players. I've got no clue how to make it check to baddies. How would I go about doing this?
Reply With Quote