示例#1
0
    public bool SetDead(bool sfx)
    {
        // check if "alive"
        if (IsDead || Class.DeadObject < 0 || Class.DeadObject == Class.ID)
        {
            return(false);
        }

        IsDead = true;

        // spawn dead sfx.
        if (sfx)
        {
            Server.SpawnProjectileSimple(AllodsProjectile.FireWall, null, X + 0.5f, Y + 0.5f, 0, 1);
        }

        // set current class id to deadobject.
        ObstacleClass deadClass = ObstacleClassLoader.GetObstacleClassById(Class.DeadObject);

        if (deadClass == null)
        {
            return(false);
        }

        Class        = deadClass;
        CurrentFrame = 0;
        CurrentTime  = 0;
        DoUpdateView = true;
        return(true);
    }
示例#2
0
    public bool SetDead(bool sfx)
    {
        // check if "alive"
        if (IsDead || Class.DeadObject < 0 || Class.DeadObject == Class.ID)
        {
            return(false);
        }

        IsDead       = true;
        NeedDeathSFX = sfx;
        WasDead      = false;

        // set current class id to deadobject.
        ObstacleClass deadClass = ObstacleClassLoader.GetObstacleClassById(Class.DeadObject);

        if (deadClass == null)
        {
            return(false);
        }

        Class        = deadClass;
        CurrentFrame = 0;
        CurrentTime  = 0;
        DoUpdateView = true;
        return(true);
    }
示例#3
0
 public MapObstacle(string name)
 {
     Class = ObstacleClassLoader.GetObstacleClassByName(name);
     if (Class == null)
     {
         Debug.LogFormat("Invalid obstacle created (name={0})", name);
     }
     else
     {
         InitObstacle();
     }
 }
示例#4
0
 public MapObstacle(int typeId)
 {
     Class = ObstacleClassLoader.GetObstacleClassById(typeId);
     if (Class == null)
     {
         Debug.LogFormat("Invalid obstacle created (typeId={0})", typeId);
     }
     else
     {
         InitObstacle();
     }
 }
示例#5
0
 private void ClassLoadThreadProc()
 {
     try
     {
         TemplateLoader.LoadTemplates();
         ObstacleClassLoader.InitClasses();
         StructureClassLoader.InitClasses();
         UnitClassLoader.InitClasses();
         ItemClassLoader.InitClasses();
         ProjectileClassLoader.InitClasses();
         ClassLoadThreadDone = true;
     }
     catch (Exception e)
     {
         Debug.LogErrorFormat("Exception while loading classes.\n{0}", e.ToString());
         ClassLoadThreadDone = true;
     }
 }