//When I first spawn a world thing I need to run setup on it so that it does basic stuff like place itself public ActorModel(TileModel start, ThingTypes thingType) { ID = Guid.NewGuid(); Type = thingType; SetLocation(start); if (!ModelManager.AllThings.ContainsKey(ID)) { ModelManager.AllThings.Add(ID, this); } switch (thingType) { case ThingTypes.Skeleton: Species = God.Library.GetRandomMonster().Type; AddTrait(Traits.Monster); break; case ThingTypes.Player: AddTrait(Traits.Player); break; case ThingTypes.ScoreThing: AddTrait(Traits.Score); break; case ThingTypes.RedKey: AddTrait(Traits.Key); break; case ThingTypes.MagicDoor: AddTrait(Traits.Door); break; } }
public MonsterType GetMonster(MonsterType.Types t) { foreach (MonsterType m in Monsters) { if (m.Type == t) { return(m); } } return(null); }
public ActorModel(TileModel start, ThingTypes thingType) { ID = Guid.NewGuid(); Type = thingType; SetLocation(start); if (!ModelManager.AllActors.ContainsKey(ID)) { ModelManager.AllActors.Add(ID, this); } switch (thingType) { case ThingTypes.Monster: //Species = God.Library.GetRandomMonster().Type; //AddTrait(Traits.Monster); if (God.MonsterSwitch) { Species = God.Library.Monsters[1].Type; Debug.Log(Species); God.MonsterSwitch = false; AddTrait(Traits.Monster); } else if (!God.MonsterSwitch) { Species = God.Library.Monsters[0].Type; Debug.Log(Species); God.MonsterSwitch = true; AddTrait(Traits.Monster); } break; case ThingTypes.Player: AddTrait(Traits.Player); break; case ThingTypes.ScoreThing: AddTrait(Traits.Score); break; case ThingTypes.RedKey: AddTrait(Traits.Key); break; case ThingTypes.MagicDoor: AddTrait(Traits.Door); break; } }