public static void LegendaryKillHealer_Uninstall() { PlayerFighter component = PlayerInfo.GetPlayer().GetComponent <PlayerFighter>(); component.onKill -= KillHealer; effectValueL8 = 0; }
public async Task Tri(SocketGuildUser user = null) { user = user ?? (SocketGuildUser)Context.User; var account = UserAccounts.GetAccount(user); var embed = new EmbedBuilder(); var p = new PlayerFighter(user); embed.WithColor(Colors.Get(account.Element.ToString())); var author = new EmbedAuthorBuilder(); author.WithName(user.DisplayName()); author.WithIconUrl(user.GetAvatarUrl()); embed.WithAuthor(author); embed.WithThumbnailUrl(user.GetAvatarUrl()); embed.AddField("Server Stats", JsonConvert.SerializeObject(account.ServerStats, Formatting.Indented)); embed.AddField("Battle Stats", JsonConvert.SerializeObject(account.BattleStats, Formatting.Indented)); embed.AddField("Unlocked Classes", account.BonusClasses.Length == 0 ? "none" : string.Join(", ", account.BonusClasses)); var Footer = new EmbedFooterBuilder(); Footer.WithText("Joined this Server on " + user.JoinedAt.Value.Date.ToString("dd-MM-yyyy")); Footer.WithIconUrl(Sprites.GetImageFromName("Iodem")); embed.WithFooter(Footer); //await Context.User.SendMessageAsync("", false, embed.Build()); await Context.Channel.SendMessageAsync("", false, embed.Build()); }
// INTERFACE ------------------------------------------------- void Awake() { _transform = transform; _pControl = _transform.GetComponent <PlayerControl>(); _pInputs = _transform.GetComponent <PlayerInputs>(); _pFighter = _transform.GetComponent <PlayerFighter>(); }
private static SelectMenuBuilder GetTargetMenu(PlayerFighter player) { var targets = player.SelectedMove.OnEnemy ? player.Enemies : player.Party; if ((player.SelectedMove.TargetType & TargetType.NoAim) == player.SelectedMove.TargetType || targets.Count <= 1) { return(null); } var team = targets.First().Party; List <SelectMenuOptionBuilder> options = new(); foreach (var f in targets) { var emote = f.IsAlive ? null : Emotes.GetEmote("Dead"); if (f.Stats.HP != 0 && 100 * f.Stats.HP / f.Stats.MaxHP <= 10) { emote = Emote.Parse("<:Exclamatory:549529360604856323>"); } options.Add(new SelectMenuOptionBuilder { Label = $"{f.Name}", Value = $"{options.Count}", Emote = emote, IsDefault = player.HasSelected && team.IndexOf(f) == player.SelectedMove.TargetNr }); } return(new SelectMenuBuilder($"{nameof(SelectTargetAction)}", options, "Select a Target")); }
public static void LegendaryAttackHealer_Uninstall() { PlayerFighter component = PlayerInfo.GetPlayer().GetComponent <PlayerFighter>(); component.onDealDamage -= AttackHealer; effectValueL6 = 0; }
public static MessageComponent GetSummonsComponent(PlayerFighter player) { var factory = player.Factory; ComponentBuilder builder = new(); foreach (var move in factory.PossibleSummons) { var isSelection = player.SelectedMove == move; var style = isSelection ? ButtonStyle.Success : ButtonStyle.Primary; style = move.InternalValidSelection(player) ? style : ButtonStyle.Secondary; builder.WithButton($"{move.Name}", $"{nameof(SelectMoveAction)}.{move.Name}", style, move.GetEmote()); } if (player.SelectedMove != null) { var sm = GetTargetMenu(player); if (sm != null) { builder.WithSelectMenu(sm); } } return(builder.Build()); }
public static MessageComponent GetPlayerControlComponents(PlayerFighter player) { ComponentBuilder builder = new(); foreach (var move in player.Moves) { if (move is Summon) { continue; } var isSelection = player.SelectedMove == move; var style = isSelection ? ButtonStyle.Success : ButtonStyle.Primary; style = move.InternalValidSelection(player) ? style : ButtonStyle.Secondary; builder.WithButton($"{move.Name}{(move is Psynergy p ? $" - {p.PpCost}" : "")}", $"{nameof(SelectMoveAction)}.{move.Name}", style, move.GetEmote()); } if (player.SelectedMove != null) { var sm = GetTargetMenu(player); if (sm != null) { builder.WithSelectMenu(sm); } } return(builder.Build()); }
public static void LegendaryCritMaker_Uninstall() { PlayerFighter component = PlayerInfo.GetPlayer().GetComponent <PlayerFighter>(); component.onBeforeAttack -= CritMaker; effectValueL7 = 0; }
// TODO: wacky shit ahead / unsure how the player will enter the level in a real game public void SpawnPlayerInitial() { // * // * Inventory // * inventory = GetComponent <PlayerInventory>(); List <Item> toEquip = inventory.Init(); // items need to be initialized before they are equipped // * // * Create the ship and equip it // * ship = inventory.EquipShip(spawnPoint.position, spawnPoint.rotation).GetComponent <PlayerFighter>(); for (int i = 0; i < toEquip.Count; i++) { Item itemToEquip = toEquip[i]; inventory.EquipItem(itemToEquip); } // * // * Camera // * // playerCamera = GameObject.Instantiate(playerCameraPrefab, ship.transform.position, ship.transform.rotation, null); UIController.instance.GetComponent <Canvas>().worldCamera = camera.GetComponentInChildren <Camera>(); UIController.instance.GetComponent <Canvas>().planeDistance = 1; UIController.instance.playerUI.SetPlayer(this); cameraController.MainCamera = camera.GetComponentInChildren <Camera>(); cameraController.CameraTransform = camera.transform; camera = camera.GetComponent <PlayerCamera>(); camera.target = ship.transform; // Camera needs to be reset to new player fighter }
private void LoadFighters(Resources res, GameHandler gameHandler) { for (int i = 0; i < /*this.enemyIDs.Count()*/ 1; i++) { this.enemies.Add(new EnemyFighter(this.enemyIDs[i], gameHandler.lastEncounteredEnemy.level, enemyScreenPositions[i])); this.enemies[i].LoadContent(res); this.aliveEnemyPositions.Add(i); } this.enemyTemplate = enemies[0]; this.removedCounter = 0; this.player = new PlayerFighter(playerScreenPos); this.player.attackList = MoveLoader.ConvertIDsToMoves(gameHandler.worldData.unlockedSkillIDs); for (int i = 0; i < this.player.attackList.Count(); i++) { List <FrameAnim> primaryAnims = new List <FrameAnim>(); for (int j = 0; j < res.MovePrimaryAnimsPerMove[Move.ID_DICT[this.player.attackList[i].moveName]].Count(); j++) { primaryAnims.Add(res.MovePrimaryAnims[res.MovePrimaryAnimsPerMove[Move.ID_DICT[this.player.attackList[i].moveName]][j]]); } this.player.attackList[i].LoadContent(primaryAnims, res.MoveSecondaryAnims[Move.ID_DICT[player.attackList[i].moveName]]); this.player.attackList[i].PrimeMove(player.standbyScreenPos, enemies[0].curScreenPos, 50, .35); } }
private void Awake() { mover = GetComponent <PlayerMover>(); fighter = GetComponent <PlayerFighter>(); thrower = GetComponent <PlayerThrower>(); weaponHandler = GetComponentInChildren <WeaponHandler>(); stashSystem = FindObjectOfType <WeaponStashSystem>(); }
public void EnableScript(playerReference _fighter) { enabled = true; _counter.enabled = true; entity = _fighter; _pFighter = _fighter.reference.transform.GetComponent <PlayerFighter>(); isStarted = true; }
// INTERFACE ----------------------------------------------------- void Start() { _transform = transform; _pController = _transform.GetComponent <PlayerControl>(); _pFighter = _transform.GetComponent <PlayerFighter>(); _pHandler = _transform.GetComponent <PlayerHandler>(); _player = ReInput.players.GetPlayer(_pHandler.id); }
public override void Collect(PlayerFighter collector) { base.Collect(collector); TurnManager turnManager = GameDataTracker.combatExecutor.turnManager; turnManager.EmptyList(); turnManager.GoodGuysFirst(); RemoveObject(); }
private void Awake() { mover = GetComponent <Mover>(); fighter = GetComponent <PlayerFighter>(); interacter = GetComponent <Interacter>(); health = GetComponent <Health>(); playerCursor = GetComponent <PlayerCursor>(); abilityManager = GetComponent <AbilityManager>(); animator = GetComponent <Animator>(); scheduler = GetComponent <ActionScheduler>(); }
public void StartCombat() { foreach (Button button in playerActionButtons) { button.interactable = false; } playerFighter = Instantiate(playerFighterPrefab); enemyFighter = Instantiate(enemyFighterPrefab); StartCoroutine(BattleFlow()); }
public void SetFighters(PlayerFighter fighter0, PlayerFighter fighter1) { this.fighter0 = fighter0; this.fighter1 = fighter1; fighter0.Rival = fighter1; fighter1.Rival = fighter0; fighter0.Room = this; fighter1.Room = this; }
public void UnequipItem(Item i) { Debug.Log(i.name + " " + i.id); Debug.Log(equipmentMap[i].gameObject.name); Destroy(equipmentMap[i].gameObject); equipmentMap.Remove(i); if (i.itemType == ItemType.Ship) { currentShip = null; playerFighter = null; } }
//--- L6 End --- //--- L7 Start --- public static void LegendaryCritMaker_Install(float value) { PlayerFighter component = PlayerInfo.GetPlayer().GetComponent <PlayerFighter>(); component.onBeforeAttack -= CritMaker; component.onBeforeAttack += CritMaker; if (effectValueL7 == 0) { effectValueL7 = value; } else { effectValueL7 = Mathf.Min(effectValueL7, value); } }
public void StartCombat() { playerFighter = Instantiate(playerFighterPrefab); enemyFighter = Instantiate(enemyFighterPrefab); fighters = new List <Fighter>() { playerFighter, enemyFighter }; if (UnityEngine.Random.value > .5f) { fighters.Reverse(); } StartCoroutine(BattleFlow()); }
public GameObject EquipShip(Item shipItem, Vector3 position, Quaternion rotation) { GameObject shipPrefab = shipItem.prefab; // * // * Create ship // * var shipGameObject = GameObject.Instantiate(shipPrefab, position, rotation); shipGameObject.layer = 12; // PlayerObject layer var ship = shipGameObject.GetComponent <Ship>(); // * // * Assign ship MinorFaction // * // TODO // ship.Faction = faction; // faction.AddTargetable(shipGameObject.GetComponent<Health>()); // * // * Setup particles and add PlayerFighter to the ship // * var playerFighter = shipGameObject.GetComponent <PlayerFighter>(); playerFighter.player = player; playerFighter.playerInput = player.input; this.playerFighter = playerFighter; // this.playerFighter.Init(); List <Item> equipped = new List <Item>(); foreach (Item key in equipmentMap.Keys) { // Debug.Log(items.Find((item) => item.id == key.id && item.itemType != ItemType.Ship)); equipped.Add(items.Find((item) => item.id == key.id && item.itemType != ItemType.Ship)); } equipmentMap.Clear(); foreach (Item toEquip in equipped) { EquipItem(toEquip); } // UIController.instance.playerUI.SetPlayerFighter(this.playerFighter); equipmentMap.Add(shipItem, shipGameObject); return(shipGameObject); }
// 初始化数据 public void InitPlayerInfo(PlayerFighter fighter) { this.ID = fighter.ID; this.maxHp = fighter.maxHp; this.hp = fighter.maxHp; allCards = new List <CardFighterUI>(); foreach (CardFighter card in fighter.allCard) { card.Reset(); CardFighterUI newCardUI = NGUITools.AddChild(cardInitArea.cardParent, cardPrefab.gameObject).GetComponent <CardFighterUI>(); newCardUI.InitCardUI(card); allCards.Add(newCardUI); newCardUI.SetDirection(direction); } allCards.ForEach(card => cardInitArea.cards.Add(card)); }
public async Task Xp() { var user = (SocketGuildUser)Context.User; var account = UserAccounts.GetAccount(user); var embed = new EmbedBuilder(); var p = new PlayerFighter(user); embed.WithColor(Colors.Get(account.Element.ToString())); var author = new EmbedAuthorBuilder(); author.WithName(user.DisplayName()); author.WithIconUrl(user.GetAvatarUrl()); embed.WithAuthor(author); embed.AddField("Level", account.LevelNumber, true); embed.AddField("XP", account.XP, true); embed.AddField("XP to level up", Leveling.XPforNextLevel(account.XP), true); await Context.Channel.SendMessageAsync("", false, embed.Build()); }
//--- L5 End --- //--- L6 Start --- public static void LegendaryAttackHealer_Install(float value) { PlayerFighter component = PlayerInfo.GetPlayer().GetComponent <PlayerFighter>(); playerHealth = PlayerInfo.GetPlayer().GetComponent <Health>(); component.onDealDamage -= AttackHealer; component.onDealDamage += AttackHealer; value /= 100f; if (effectValueL6 == 0) { effectValueL6 = value; } else { effectValueL6 = Mathf.Max(effectValueL6, value); } }
//--- L7 End --- //--- L8 Start --- public static void LegendaryKillHealer_Install(float value) { PlayerFighter component = PlayerInfo.GetPlayer().GetComponent <PlayerFighter>(); playerHealth = PlayerInfo.GetPlayer().GetComponent <Health>(); component.onKill -= KillHealer; component.onKill += KillHealer; value /= 100; if (effectValueL8 == 0) { effectValueL8 = value; } else { effectValueL8 = Mathf.Max(effectValueL8, value); } }
public async Task Status(SocketGuildUser user = null) { user = user ?? (SocketGuildUser)Context.User; var account = UserAccounts.GetAccount(user); var embed = new EmbedBuilder(); var p = new PlayerFighter(user); embed.WithColor(Colors.Get(account.Element.ToString())); var author = new EmbedAuthorBuilder(); author.WithName($"{user.DisplayName()}"); author.WithIconUrl(user.GetAvatarUrl()); embed.WithAuthor(author); //embed.WithThumbnailUrl(user.GetAvatarUrl()); //embed.WithDescription($"Status."); //embed.AddField("Element", account.element, true); embed.AddField("Level", account.LevelNumber, true); embed.AddField("XP", $"{account.XP} - next in {Leveling.XPforNextLevel(account.XP)}", true); embed.AddField("Rank", UserAccounts.GetRank(user) + 1, true); embed.AddField("Class", account.GsClass, true); embed.AddField("Colosso wins/streak", $"{account.ServerStats.ColossoWins} | {account.ServerStats.ColossoHighestStreak} ", true); embed.AddField("Colosso/Showdown Streaks", $"Solo: {account.ServerStats.ColossoHighestRoundEndlessSolo} | Duo: {account.ServerStats.ColossoHighestRoundEndlessDuo} \nTrio: {account.ServerStats.ColossoHighestRoundEndlessTrio} | Quad: {account.ServerStats.ColossoHighestRoundEndlessQuad}", true); embed.AddField("Current Equip", account.Inv.GearToString(AdeptClassSeriesManager.GetClassSeries(account).Archtype), true); embed.AddField("Psynergy", p.GetMoves(false), false); embed.AddField("Stats", p.stats.ToString(), true); embed.AddField("Elemental Stats", p.elstats.ToString(), true); embed.AddField("Unlocked Classes", account.BonusClasses.Length == 0 ? "none" : string.Join(", ", account.BonusClasses)); var Footer = new EmbedFooterBuilder(); Footer.WithText("Joined this Server on " + user.JoinedAt.Value.Date.ToString("dd-MM-yyyy")); Footer.WithIconUrl(Sprites.GetImageFromName("Iodem")); embed.WithFooter(Footer); await Context.Channel.SendMessageAsync("", false, embed.Build()); }
public void Show(PlayerFighter playerFighter, Fighter[] targets) { this.gameObject.SetActive(true); this.targetFighter = playerFighter; int btnIndex = 0; foreach (var target in targets) { EnemyButtonUI btn = this.ActivateNextButton(btnIndex); btn.SetText(target.idName); this.targets.Add(target); btnIndex++; } this.rectTransform.sizeDelta = new Vector2( this.rectTransform.rect.width, this.baseHeight * targets.Length ); }
void TestFight() { PlayerFighter player0 = new PlayerFighter(); player0.ID = 10000; player0.maxHp = player0.HP = 10000; PlayerFighter player1 = new PlayerFighter(); player1.ID = 10001; player1.maxHp = player1.HP = 10000; BattleRoom room = new BattleRoom(); for (int i = 1; i <= 2; i++) { CardData cardData = new CardData(); cardData.cardTemplateID = i; cardData.cardLevel = 10; cardData.ID = i; CardFighter card = CardFighter.NewCard(cardData); if (i < 2) { card.owner = player0; player0.allCard.Add(card); } else { card.owner = player1; player1.allCard.Add(card); } } room.SetFighters(player0, player1); room.StartFight(); gameObject.GetComponentInChildren <BattleRoomUI>().gameObject.AddComponent <BattleControl>().StartFight(room); }
protected override Task <(bool Success, string Message)> CheckCustomPreconditionsAsync() { var baseResult = base.CheckCustomPreconditionsAsync(); if (!baseResult.Result.Success) { return(baseResult); } if (!BattleService.UserInBattle(Context.User.Id)) { return(Task.FromResult((false, "You aren't in a battle."))); } Player = Battle.GetPlayer(Context.User.Id); if (Player == null) { return(Task.FromResult((false, "You aren't in this battle."))); } if (!Battle.IsUsersMessage(Player, Context.Message)) { return(Task.FromResult((false, "Click your own message!"))); } if (Battle.IsProcessing) { return(Task.FromResult((false, "Too fast."))); } if (!Player.IsAlive) { return(Task.FromResult((false, "You are dead."))); } return(baseResult); }
public void ShowForPlayer(PlayerFighter newTarget) { this.gameObject.SetActive(true); this.targetFigther = newTarget; }