public override string Print(bool link = true, DwarfObject pov = null) { string eventString = GetYearTime(); eventString += Trickster?.ToLink(link, pov, this) ?? "an unknown creature"; if (Target != null) { eventString += " fooled "; eventString += Target?.ToLink(link, pov, this) ?? "an unknown civilization"; eventString += " into believing "; eventString += Trickster?.ToLink(link, pov, this) ?? "an unknown creature"; eventString += " was "; } else { eventString += " assumed the identity of "; } Identity identity = Trickster?.Identities.FirstOrDefault(i => i.Id == IdentityId) ?? Identity; if (identity != null) { eventString += identity.Print(link, pov, this); } else { eventString += "someone else"; } eventString += PrintParentCollection(link, pov); eventString += "."; return(eventString); }
static void Postfix(VentButton __instance) { // Trickster render special vent button if (Trickster.trickster != null && Trickster.trickster == PlayerControl.LocalPlayer) { if (defaultVentSprite == null) { defaultVentSprite = __instance.graphic.sprite; } bool isSpecialVent = __instance.currentTarget != null && __instance.currentTarget.gameObject != null && __instance.currentTarget.gameObject.name.StartsWith("JackInTheBoxVent_"); __instance.graphic.sprite = isSpecialVent ? Trickster.getTricksterVentButtonSprite() : defaultVentSprite; __instance.buttonLabelText.enabled = !isSpecialVent; } }
public override string Print(bool link = true, DwarfObject pov = null) { string eventString = GetYearTime(); eventString += Trickster?.ToLink(link, pov) ?? "an unknown creature"; eventString += " fooled "; eventString += Target?.ToLink(link, pov) ?? "an unknown civilization"; eventString += " into believing "; eventString += Trickster?.ToLink(link, pov) ?? "an unknown creature"; eventString += " was "; eventString += Identity.ToLink(link, pov); eventString += PrintParentCollection(link, pov); eventString += "."; return(eventString); }
public AssumeIdentity(List <Property> properties, World world) : base(properties, world) { foreach (Property property in properties) { switch (property.Name) { case "trickster_hfid": Trickster = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); break; case "identity_id": property.Known = true; Identity = HistoricalFigure.Unknown; break; // TODO Bad ID, so unknown for now. case "target_enid": Target = world.GetEntity(Convert.ToInt32(property.Value)); break; case "trickster": if (Trickster == null) { Trickster = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); } else { property.Known = true; } break; case "target": if (Target == null) { Target = world.GetEntity(Convert.ToInt32(property.Value)); } else { property.Known = true; } break; } } Trickster.AddEvent(this); Identity.AddEvent(this); Target.AddEvent(this); }
public AssumeIdentity(List <Property> properties, World world) : base(properties, world) { foreach (Property property in properties) { switch (property.Name) { case "identity_id": IdentityId = Convert.ToInt32(property.Value); break; case "target_enid": Target = world.GetEntity(Convert.ToInt32(property.Value)); break; case "identity_histfig_id": case "identity_nemesis_id": case "trickster_hfid": case "trickster": if (Trickster == null) { Trickster = world.GetHistoricalFigure(Convert.ToInt32(property.Value)); } else { property.Known = true; } break; case "target": if (Target == null) { Target = world.GetEntity(Convert.ToInt32(property.Value)); } else { property.Known = true; } break; case "identity_name": IdentityName = property.Value; break; case "identity_race": IdentityRace = world.GetCreatureInfo(property.Value); break; case "identity_caste": IdentityCaste = string.Intern(Formatting.InitCaps(property.Value.ToLower().Replace('_', ' '))); break; } } Trickster.AddEvent(this); Target.AddEvent(this); if (!string.IsNullOrEmpty(IdentityName)) { Identity = new Identity(IdentityName, IdentityRace, IdentityCaste); } }
public void AddEnemy(int enemyint, int _x, float _y = 0f) { float x = 0f; if (_x == 0) { x = Random.Range(-0.95f, 0.95f); } else { x = ((float)_x / 100 - 0.5f) * 2; } string enemy; if (enemyint == 0) { enemy = "LightShip"; } else if (enemyint == 1) { enemy = "MediumShip"; } else if (enemyint == 2) { enemy = "HeavyShip"; } else if (enemyint == 3) { enemy = "SuperHeavyShip"; } else if (enemyint == 4) { enemy = "Bomber"; } else if (enemyint == 5) { enemy = "Trickster"; } else if (enemyint == 6) { enemy = "Teleporter"; } else if (enemyint == 7) { enemy = "InvisibleShip"; } else if (enemyint == 8) { enemy = "Cluster"; } else if (enemyint == 9) { enemy = "Carrier"; } else if (enemyint == 10) { enemy = "Asteroid1"; } else if (enemyint == 11) { enemy = "Asteroid2"; } else if (enemyint == 12) { enemy = "Asteroid3"; } else if (enemyint == 13) { enemy = "Trickster"; GameObject instancet = Instantiate(Resources.Load(enemy, typeof(GameObject))) as GameObject; instancet.transform.position = new Vector2(x * stageRight, stageTop); Trickster e = instancet.GetComponent <Trickster>(); e.Left = true; return; } else if (enemyint == 14) { enemy = "Trickster"; GameObject instancet = Instantiate(Resources.Load(enemy, typeof(GameObject))) as GameObject; instancet.transform.position = new Vector2(x * stageRight, stageTop); Trickster e = instancet.GetComponent <Trickster>(); e.Left = false; return; } else { enemy = null; } GameObject instance = Instantiate(Resources.Load(enemy, typeof(GameObject))) as GameObject; instance.transform.position = new Vector2(x * stageRight, stageTop); /*enemy = new Asteroid(_x, _y, 1); * enemy.cacheAsBitmap = true; * enemiesMc.addChild(enemy); * enemy = null;*/ }