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); }
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); }
public MapObstacle(string name) { Class = ObstacleClassLoader.GetObstacleClassByName(name); if (Class == null) { Debug.LogFormat("Invalid obstacle created (name={0})", name); } else { InitObstacle(); } }
public MapObstacle(int typeId) { Class = ObstacleClassLoader.GetObstacleClassById(typeId); if (Class == null) { Debug.LogFormat("Invalid obstacle created (typeId={0})", typeId); } else { InitObstacle(); } }
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; } }