public static void CheatCodeMobility() { string currentIns = ConsoleTrack.GetArgAsString(); ConsoleTrack.PrepareTabLookup(mobilityCodes, currentIns, "Assign mobility power to the character; e.g. `power mobility levitate`"); if (ConsoleTrack.activate) { UIHandler.AddNotification(UIAlertType.Success, "Mobility Granted", "Granted Mobility Power to Character.", 180); if (mobilityCodes.ContainsKey(currentIns)) { if (currentIns == "none") { ConsoleTrack.character.mobilityPower = null; return; } byte subType = byte.Parse(mobilityCodes[currentIns].ToString()); Power.AssignPower(ConsoleTrack.character, (byte)subType); return; } // "wand" was the final valid instruction. Give a random wand to the character. Power.AssignPower(ConsoleTrack.character, (byte)PowerSubType.RandomBolt); } }
public override void Collect(RoomScene room, Character character, short gridX, short gridY) { byte subType = room.tilemap.GetMainSubType(gridX, gridY); Power.AssignPower(character, subType); room.PlaySound(Systems.sounds.collectSubtle, 1f, gridX * (byte)TilemapEnum.TileWidth, gridY * (byte)TilemapEnum.TileHeight); base.Collect(room, character, gridX, gridY); }
public static void CheatCodeRanged() { string currentIns = ConsoleTrack.GetArgAsString(); ConsoleTrack.PrepareTabLookup(rangedWeaponCodes, currentIns, "Assign a ranged weapon to the character; e.g. `power ranged axe`"); if (ConsoleTrack.activate) { UIHandler.AddNotification(UIAlertType.Success, "Weapon Granted", "Granted Ranged Weapon to Character.", 180); if (rangedWeaponCodes.ContainsKey(currentIns)) { byte subType = byte.Parse(rangedWeaponCodes[currentIns].ToString()); Power.AssignPower(ConsoleTrack.character, (byte)subType); return; } // "ranged" was the final valid instruction. Give a random ranged weapon to the character. Power.AssignPower(ConsoleTrack.character, (byte)PowerSubType.RandomThrown); } }
public static void CheatCodeMagic() { string currentIns = ConsoleTrack.GetArgAsString(); ConsoleTrack.PrepareTabLookup(magicCodes, currentIns, "Assign magic power to the character; e.g. `power magic fire`"); if (ConsoleTrack.activate) { UIHandler.AddNotification(UIAlertType.Success, "Magic Granted", "Granted Magic Spell to Character.", 180); if (magicCodes.ContainsKey(currentIns)) { byte subType = byte.Parse(magicCodes[currentIns].ToString()); Power.AssignPower(ConsoleTrack.character, (byte)subType); return; } // "wand" was the final valid instruction. Give a random wand to the character. Power.AssignPower(ConsoleTrack.character, (byte)PowerSubType.RandomPotion); } }
private void AssignParams(Dictionary <string, short> paramList) { if (paramList == null) { paramList = new Dictionary <string, short>(); } this.FaceRight = paramList.ContainsKey("dir") && paramList["dir"] == 1 ? false : true; // Apply Head byte face = paramList.ContainsKey("face") ? (byte)paramList["face"] : (byte)0; if (face == 0) { HeadMap.LanaHead.ApplyHead(this, false); } if (face == 1) { HeadMap.RyuHead.ApplyHead(this, false); } else if (face == 2) { HeadMap.PooHead.ApplyHead(this, false); } else if (face == 3) { HeadMap.CarlHead.ApplyHead(this, false); } // Suit if (paramList.ContainsKey("suit") && paramList["suit"] > 0) { Suit.AssignToCharacter(this, ParamTrack.AssignSuitIDs[(byte)paramList["suit"]], true); } // Hat if (paramList.ContainsKey("hat") && paramList["hat"] > 0) { Hat.AssignToCharacter(this, ParamTrack.AssignHatIDs[(byte)paramList["hat"]], true); } // Shoes if (paramList.ContainsKey("shoes") && paramList["shoes"] > 0) { Shoes.AssignShoe(this, ParamTrack.AssignShoeIDs[(byte)paramList["shoes"]]); } // Mobility Power if (paramList.ContainsKey("mob") && paramList["mob"] > 0) { if (paramList["mob"] == 1) { Power.RemoveMobilityPower(this); } Power.AssignPower(this, ParamTrack.AssignMobilityIDs[(byte)paramList["mob"]]); } // Attack Power byte attType = paramList.ContainsKey("att") ? (byte)paramList["att"] : (byte)0; // No Attack Power if (attType == 1) { Power.RemoveAttackPower(this); } // Weapon if (attType == 2) { byte power = paramList.ContainsKey("weapon") ? (byte)paramList["weapon"] : (byte)0; Power.AssignPower(this, ParamTrack.AssignWeaponIDs[power]); } // Spells if (attType == 3) { byte power = paramList.ContainsKey("spell") ? (byte)paramList["spell"] : (byte)0; Power.AssignPower(this, ParamTrack.AssignSpellsIDs[power]); } // Thrown if (attType == 4) { byte power = paramList.ContainsKey("thrown") ? (byte)paramList["thrown"] : (byte)0; Power.AssignPower(this, ParamTrack.AssignThrownIDs[power]); } // Bolts if (attType == 5) { byte power = paramList.ContainsKey("bolt") ? (byte)paramList["bolt"] : (byte)0; Power.AssignPower(this, ParamTrack.AssignBoltsIDs[power]); } this.stats.ResetCharacterStats(); }
protected void ReceiveFlagUpgrades(RoomScene room, Character character, short gridX, short gridY) { Dictionary <string, short> paramList = room.tilemap.GetParamList(gridX, gridY); // Suit if (paramList.ContainsKey("suit") && paramList["suit"] > 0) { Suit.AssignToCharacter(character, ParamTrack.AssignSuitIDs[(byte)paramList["suit"]], true); } // Hat if (paramList.ContainsKey("hat") && paramList["hat"] > 0) { Hat.AssignToCharacter(character, ParamTrack.AssignHatIDs[(byte)paramList["hat"]], true); } // Shoes if (paramList.ContainsKey("shoes") && paramList["shoes"] > 0) { Shoes.AssignShoe(character, ParamTrack.AssignShoeIDs[(byte)paramList["shoes"]]); } // Mobility Power if (paramList.ContainsKey("mob") && paramList["mob"] > 0) { if (paramList["mob"] == 1) { Power.RemoveMobilityPower(character); } Power.AssignPower(character, ParamTrack.AssignMobilityIDs[(byte)paramList["mob"]]); } // Attack Power byte attType = paramList.ContainsKey("att") ? (byte)paramList["att"] : (byte)0; // No Attack Power if (attType == 1) { Power.RemoveAttackPower(character); } // Weapon if (attType == 2) { byte power = paramList.ContainsKey("weapon") ? (byte)paramList["weapon"] : (byte)0; Power.AssignPower(character, ParamTrack.AssignWeaponIDs[power]); } // Spells if (attType == 3) { byte power = paramList.ContainsKey("spell") ? (byte)paramList["spell"] : (byte)0; Power.AssignPower(character, ParamTrack.AssignSpellsIDs[power]); } // Thrown if (attType == 4) { byte power = paramList.ContainsKey("thrown") ? (byte)paramList["thrown"] : (byte)0; Power.AssignPower(character, ParamTrack.AssignThrownIDs[power]); } // Bolts if (attType == 5) { byte power = paramList.ContainsKey("bolt") ? (byte)paramList["bolt"] : (byte)0; Power.AssignPower(character, ParamTrack.AssignBoltsIDs[power]); } character.stats.ResetCharacterStats(); }