//--------------------------------------------------- // ItemSpeedDecisionFunc //--------------------------------------------------- int ItemSpeedDecisionFunc(ItemSpawnData item) { List <CharacterModel.Data> playerList = GetTeamCharacterDataList(TEAM_TYPE.PLAYER); float length = 1000; int executeActorId = -1; StateMachine <CHARACTER_MOVE_STATE> stateMachine; foreach (CharacterModel.Data character in playerList) { if (_getReservItemList.ContainsValue(character.ActorId) || character.Hp <= 0) { continue; } stateMachine = _characterStateList [character.ActorId]; CHARACTER_MOVE_STATE state = stateMachine.CurrentStateKey; if (length > (character.BlockPos - item.BlockPos).magnitude && state == CHARACTER_MOVE_STATE.ATTACK) { executeActorId = character.ActorId; } } return(executeActorId); }
//--------------------------------------------------- // ItemRecoverDecisionFunc //--------------------------------------------------- int ItemRecoverDecisionFunc(ItemSpawnData item) { List <CharacterModel.Data> playerList = GetTeamCharacterDataList(TEAM_TYPE.PLAYER); int executeActorId = -1; float hpRate = 1; StateMachine <CHARACTER_MOVE_STATE> stateMachine; foreach (CharacterModel.Data character in playerList) { if (_getReservItemList.ContainsValue(character.ActorId) || character.Hp <= 0) { continue; } stateMachine = _characterStateList [character.ActorId]; CHARACTER_MOVE_STATE state = stateMachine.CurrentStateKey; float dstHpRate = character.Hp / character.MaxHp; if (hpRate > dstHpRate && state == CHARACTER_MOVE_STATE.ATTACK) { hpRate = dstHpRate; executeActorId = character.ActorId; } } return(executeActorId); }
//--------------------------------------------------- // ItemSpawnCallback //--------------------------------------------------- override public void ItemSpawnCallback(ItemSpawnData itemData) { if (itemData.ItemType == ItemData.ITEM_TYPE.ATTACK_UP) { //Debug.Log("攻撃力アップアイテム"); } else if (itemData.ItemType == ItemData.ITEM_TYPE.SPEED_UP) { //Debug.Log("スピードアップアイテム"); } else if (itemData.ItemType == ItemData.ITEM_TYPE.HP_RECOVER) { //Debug.Log("回復アイテム"); } //生成された位置 //Debug.Log(itemData.BlockPos); }
//--------------------------------------------------- // MoveUpdateGetItemAttackState //--------------------------------------------------- void CharacterGetItemMoveStateEnter(StateData data) { CharacterModel.Data character = GetAliveActor(_currentActorId, TEAM_TYPE.PLAYER); if (character == null) { return; } int itemActorId = (int)data.table["itemActorId"]; int index = _stageItemDataList.FindIndex(obj => obj.ActorId == itemActorId); if (index < 0) { _characterStateList[_currentActorId].SetNextState(CHARACTER_MOVE_STATE.ATTACK); } else { ItemSpawnData item = _stageItemDataList[index]; List <Vector2> moveList = MoveTargetBlock(character.ActorId, item.BlockPos); data.table = Common.CreateHashTable("itemActorId", item.ActorId, "moveList", moveList); } }
//--------------------------------------------------- // ItemSpawnCallback //--------------------------------------------------- override public void ItemSpawnCallback(ItemSpawnData itemData) { x = itemData.BlockPos.x; y = itemData.BlockPos.y; }
/// <summary> /// アイテムがステージ上に出現したときに呼ばれるコールバック /// </summary> /// <remarks> /// スポーン時にしか呼ばれないので注意 /// </remarks> /// <param name="itemData">アイテムデータ</param> virtual public void ItemSpawnCallback(ItemSpawnData itemData) { }
//--------------------------------------------------- // ItemSpawnCallback //--------------------------------------------------- override public void ItemSpawnCallback(ItemSpawnData itemData) { }
//--------------------------------------------------- // ItemSpawnCallback //--------------------------------------------------- override public void ItemSpawnCallback(ItemSpawnData itemData) { _stageItemDataList.Add(itemData); }
//--------------------------------------------------- // ItemSpawnCallback //--------------------------------------------------- override public void ItemSpawnCallback(ItemSpawnData itemData) { ItemPos.Add(itemData.BlockPos); }
public void SetItemData(ItemSpawnData data) { IsItemData = data; }
override public void ItemSpawnCallback(ItemSpawnData itemData) { SetItemData(itemData); //IsSetItem = true; }