public Serializator Get(out Critter cr) { cr = null; if (curPos + 4 > DataSize) { return(this); } uint id = 0; id |= (uint)buffer[curPos++] << 24; id |= (uint)buffer[curPos++] << 16; id |= (uint)buffer[curPos++] << 8; id |= (uint)buffer[curPos++]; cr = Global.GetCritter(id); return(this); }
public static bool AddAttackPlane(this Critter npc, uint priority, uint critId) { Critter target = Global.GetCritter(critId); if (target == null) { Global.Log("Target not found."); return(false); } NpcPlane plane = Global.CreatePlane(); plane.Type = PlaneType.Attack; plane.Priority = (priority == 0?Priorities.Attack:priority); plane.Attack_TargId = target.Id; plane.Attack_MinHp = Global.DeadHitPoints; plane.Attack_IsGag = false; plane.Attack_GagHexX = 0; plane.Attack_GagHexY = 0; plane.Attack_LastHexX = target.HexX; plane.Attack_LastHexY = target.HexY; plane.Run = false; return(npc.AddPlane(plane)); }
static Critter GetCritter() { return(Global.GetCritter(5000003)); }