public LevelScene(bool grantCampaignEquipment) : base() { // Defaults this.isSinglePlayer = true; // UI State UIHandler.SetUIOptions(false, false); UIHandler.SetMenu(null, false); // Create UI this.levelUI = new LevelUI(); // Generate Each Room Class this.rooms = new RoomScene[8]; for (byte roomID = 0; roomID < Systems.handler.levelContent.data.rooms.Count; roomID++) { this.rooms[roomID] = new RoomScene(this, roomID); } // If we're on single player, Systems.localServer.ResetPlayers(); // Restart the level, generate all rooms. this.RestartLevel(true); // Update Character with World Map abilities (if applicable) if (grantCampaignEquipment) { Character character = Systems.localServer.MyCharacter; CampaignState campaign = Systems.handler.campaignState; // Update Character Equipment if (campaign is CampaignState) { if (character.suit is Suit == false || !character.suit.IsPowerSuit) { Suit.AssignToCharacter(character, campaign.suit, true); } if ((character.hat is Hat == false || !character.hat.IsPowerHat) && (character.hat == null || !character.hat.IsCosmeticHat || campaign.hat != 0)) { Hat.AssignToCharacter(character, campaign.hat, true); } if (character.shoes is Shoes == false) { Shoes.AssignShoe(character, campaign.shoes); } if (character.attackPower is PowerAttack == false) { PowerAttack.AssignPower(character, campaign.powerAtt); } if (character.mobilityPower is PowerMobility == false) { PowerMobility.AssignPower(character, campaign.powerMob); } if (character.wounds.Health < campaign.health) { character.wounds.SetHealth(campaign.health); } if (character.wounds.Armor < campaign.armor) { character.wounds.SetArmor(campaign.armor); } } } // Play or Stop Music Systems.music.Play((byte)Systems.handler.levelContent.data.music); }
private void CollectShoe(Character character, ShoeSubType shoeSub) { Shoes.AssignShoe(character, (byte)shoeSub); character.room.PlaySound(Systems.sounds.collectSubtle, 1f, character.posX + 16, character.posY + 16); }
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(); }