Exemplo n.º 1
0
 // Use this for initialization
 protected virtual void Start()
 {
     centerOffset = transform.position - target.position;
     originalcenterOffset = centerOffset;
     playerActor = target.root.GetComponent<PlayerActor>();
     playerInput = target.root.GetComponent<PlayerInput>();
 }
    public void UpdateStatus(PlayerActor currentPlayer)
    {
        //		m_useLabel.label.text = (m_currentPlayer.CanEatItem(currentIndex) ? "たべる" : "つかう");
        //		m_equipLabel.label.text = (m_currentPlayer.IsEquippingItem(currentIndex) ? "はずす" : "みにつける");

        string statusStr = string.Empty;
        // TODO:
        //		if(currentPlayer.IsPoison) {
        //			statusStr += "どく "
        //		}

        string nameText = string.Format (nameFormat,	// 5 items
                                         currentPlayer.charName,
                                         (int)currentPlayer.level, // level
                                         (int)currentPlayer.exp, // exp
                                         (int)(currentPlayer.nextExp - currentPlayer.exp), // nextexp
                                         statusStr 		//status
                                         );
        string statusText = string.Format (leftStatusFormat,	// 23 items
                                         currentPlayer.hp,
                                         currentPlayer.hpMax,
                                         currentPlayer.Hunger,
                                         currentPlayer.hungerMax,
                                           currentPlayer.AP (ElementType.ET_Physical ),
                                           currentPlayer.AP (ElementType.ET_Fire	),
                                           currentPlayer.AP (ElementType.ET_Ice		),
                                           currentPlayer.AP (ElementType.ET_Electric),
                                           currentPlayer.AP (ElementType.ET_Poison	),
                                           currentPlayer.AP (ElementType.ET_Dark	),
                                           currentPlayer.AP (ElementType.ET_Holy	),
                                           currentPlayer.AP (ElementType.ET_Psycho	),
                                           currentPlayer.DP (ElementType.ET_Physical ),
                                           currentPlayer.DP (ElementType.ET_Fire	),
                                           currentPlayer.DP (ElementType.ET_Ice		),
                                           currentPlayer.DP (ElementType.ET_Electric),
                                           currentPlayer.DP (ElementType.ET_Poison	),
                                           currentPlayer.DP (ElementType.ET_Dark	),
                                           currentPlayer.DP (ElementType.ET_Holy	),
                                           currentPlayer.DP (ElementType.ET_Psycho	),
                                         currentPlayer.agility,
                                         (currentPlayer.armedWeapon == null ? "なし" : currentPlayer.armedWeapon.itemName),
                                         (currentPlayer.armedShield == null ? "なし" : currentPlayer.armedShield.itemName)
                                         );

        string itemlistText = "";
        foreach(ItemEntity e in currentPlayer.items) {
            itemlistText += e.itemName;
            itemlistText += "\n";
        }

        m_charaInfoStatusLabel.label.text = nameText;
        m_leftStatusLabel.label.text = statusText;
        m_rightStatusLabel.label.text = itemlistText;
    }
    /*
     * Action OnEnable of Window
     */
    public override void act(iGUIElement caller)
    {
        UserInput uim = UserInput.GetUserInput();

        uim.AddToItemMenuEvent(ItemMenuButton);
        uim.AddToDpadEvent(DpadButton);
        uim.AddToConformCancelEvent(ConfirmButton, CancelButton);

        // get current player
        m_currentPlayer = GameManager.GetManager().currentPlayer;
        // update item view
        _UpdateItemView();
    }
    public override void act(iGUIElement caller)
    {
        m_curIndex = 0;
        m_selectionIndicator.setPosition(_GetItemPositionForSelector(m_curIndex));

        m_currentPlayer = GameManager.GetManager().currentPlayer;

        m_pickup.passive 	= !m_currentPlayer.CanPickupItemOnGround();
        m_stamp.passive 	= !m_currentPlayer.CanStampAndStill();
        m_jump.passive 		= !m_currentPlayer.CanJump();
        m_rest.passive 	 	= !m_currentPlayer.CanRest();

        UserInput uim = UserInput.GetUserInput();
        uim.AddToDpadEvent(DpadButton);
        uim.AddToConformCancelEvent(ConfirmButton, CancelButton);
        uim.AddToActionMenuEvent(CancelButton);
    }
    //----------------------------

    private void Awake()
    {
        m_enemyInteractable = GetComponent <EnemyInteractable>();
        audioSource         = GetComponent <AudioSource>();
        playerActor         = GameObject.FindObjectOfType <PlayerActor>();
        wantedLevel         = GameObject.FindObjectOfType <WantedLevel>();

        chaseState          = new ChaseState(this);
        alertState          = new AlertState(this);
        patrolState         = new PatrolState(this);
        m_caughtPlayerState = new CaughtPlayerState(this);

        navMeshAgent       = GetComponent <NavMeshAgent>();
        navMeshAgent.speed = standartSpeed;

        enemyAnimator    = GetComponent <Animator>();
        elephantMovement = playerActor.GetComponent <ElephantMovement>();

        if (wayPoints == null)
        {
            wayPoints = new Waypoints()
            {
                points = new[] { transform.position },
                pairs  = new[] { new Pair() }
            }
        }
        ;
    }

    void OnValidate()
    {
        currentState = patrolState;
    }

    void Start()
    {
        currentState = patrolState;

        viewCone.MainViewRadius = toleratedSightrange;
        viewCone.FullViewRadius = sightRange;
        viewCone.FieldOfView    = fieldOfView;

        OnCaught += StatePatternEnemy_OnCaught;
    }
Exemplo n.º 6
0
        protected override void EnterDepop()
        {
            this.AutoChangeAnimation = false;
            StuffItemInfo _itemInfo = this.ItemInfo;
            StuffItem     _addItem  = (StuffItem)null;

            if (_itemInfo != null)
            {
                _addItem = new StuffItem(_itemInfo.CategoryID, _itemInfo.ID, 1);
            }
            PlayerActor playerActor = !Singleton <Manager.Map> .IsInstance() ? (PlayerActor)null : Singleton <Manager.Map> .Instance.Player;

            if ((!Object.op_Inequality((Object)playerActor, (Object)null) ? (List <StuffItem>)null : playerActor.PlayerData?.ItemList) != null && _addItem != null)
            {
                playerActor.PlayerData.ItemList.AddItem(_addItem);
            }
            if (Singleton <Resources> .IsInstance())
            {
                AnimalDefinePack animalDefinePack = Singleton <Resources> .Instance.AnimalDefinePack;
                if (Object.op_Inequality((Object)animalDefinePack, (Object)null))
                {
                    AudioSource audioSource = this.Play3DSound(animalDefinePack.SoundID.MechaStartup);
                    if (Object.op_Inequality((Object)audioSource, (Object)null))
                    {
                        audioSource.Stop();
                        ((Component)audioSource).get_transform().SetPositionAndRotation(this.Position, this.Rotation);
                        audioSource.Play();
                    }
                }
            }
            this.PlayInAnim(AnimationCategoryID.Etc, 1, (System.Action)(() =>
            {
                this.AutoChangeAnimation = true;
                if (_itemInfo != null && _addItem != null)
                {
                    MapUIContainer.AddSystemItemLog(_itemInfo, _addItem.Count, true);
                }
                else
                {
                    MapUIContainer.AddNotify(MapUIContainer.ItemGetEmptyText);
                }
                this.SetState(AnimalState.Destroyed, (System.Action)null);
            }));
        }
Exemplo n.º 7
0
        protected override void OnUpdate(PlayerActor player, ref Actor.InputInfo info)
        {
            player.NavMeshAgent.set_velocity(info.move = Vector3.get_zero());
            if (player.Animation.PlayingInAnimation)
            {
                return;
            }
            AnimatorStateInfo animatorStateInfo = player.Animation.Animator.GetCurrentAnimatorStateInfo(0);

            if (!((AnimatorStateInfo) ref animatorStateInfo).IsName(this._loopStateName))
            {
                return;
            }
            this._elapsedTime += Time.get_deltaTime();
            if ((double)this._elapsedTime <= (double)Singleton <Resources> .Instance.LocomotionProfile.TimeToLeftState)
            {
                ;
            }
        }
        private string ErrorText(PlayerActor player, EventType eventType, int searchAreaID)
        {
            AIProject.SaveData.Environment.SearchActionInfo searchActionInfo;
            if (Singleton <Game> .Instance.Environment.SearchActionLockTable.TryGetValue(this.RegisterID, out searchActionInfo))
            {
                EnvironmentProfile environmentProfile = Singleton <Manager.Map> .Instance.EnvironmentProfile;
                if (searchActionInfo.Count >= environmentProfile.SearchCount)
                {
                    return("しばらく採取できません");
                }
            }
            if (player.PlayerData.ItemList.Count >= player.PlayerData.InventorySlotMax)
            {
                return("ポーチがいっぱいです");
            }
            StuffItem itemInfo = player.PlayerData.EquipedSearchItem(searchAreaID);

            return(!this.CanSearch(eventType, itemInfo) ? "装備のランクが足りません" : string.Empty);
        }
Exemplo n.º 9
0
 protected override void OnAwake(PlayerActor player)
 {
     this._actorCamera  = player.CameraControl;
     this._camera       = this._actorCamera.CameraComponent;
     this._prevShotType = this._actorCamera.ShotType;
     if (this._prevShotType != ShotType.PointOfView)
     {
         this._actorCamera.ShotType = ShotType.PointOfView;
     }
     this._prevCameraChangeable = this._actorCamera.IsChangeable;
     if (this._prevCameraChangeable)
     {
         this._actorCamera.IsChangeable = false;
     }
     this._prevFieldOfView = (float)this._actorCamera.LensSetting.FieldOfView;
     this._prevDutch       = (float)this._actorCamera.LensSetting.Dutch;
     this._followRoot      = ((CinemachineVirtualCameraBase)this._actorCamera.ActiveFreeLookCamera)?.get_Follow();
     if (Object.op_Inequality((Object)this._followRoot, (Object)null))
     {
         this._prevCameraLocalPosition = this._followRoot.get_localPosition();
         this._prevCameraLocalRotation = this._followRoot.get_localRotation();
     }
     this._cameraLayer = Singleton <Resources> .Instance.DefinePack.MapDefines.MapLayer;
     MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.None);
     MapUIContainer.SetVisibleHUD(false);
     if (Singleton <Resources> .IsInstance())
     {
         LocomotionProfile.LensSettings     defaultLensSetting = Singleton <Resources> .Instance.LocomotionProfile.DefaultLensSetting;
         LocomotionProfile.PhotoShotSetting photoShot          = Singleton <Resources> .Instance.LocomotionProfile.PhotoShot;
         MapUIContainer.PhotoShotUI.SetZoomValue(Mathf.InverseLerp(defaultLensSetting.MinFOV, defaultLensSetting.MaxFOV, this._prevFieldOfView));
     }
     else
     {
         MapUIContainer.PhotoShotUI.SetZoomValue(0.5f);
     }
     MapUIContainer.SetActivePhotoShotUI(true);
     ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndAction, 1), (Action <M0>)(_ =>
     {
         this._updatable = false;
         player.PlayerController.ChangeState("Normal");
     }));
     this._updatable = true;
 }
Exemplo n.º 10
0
        protected override void OnRelease(PlayerActor player)
        {
            Vector3 locatedPosition = player.CurrentPoint.LocatedPosition;

            locatedPosition.y = ((Component)player.Locomotor).get_transform().get_position().y;
            RaycastHit raycastHit;

            Physics.Raycast(locatedPosition, Vector3.op_Multiply(Vector3.get_down(), 10f), ref raycastHit);
            locatedPosition.y = ((RaycastHit) ref raycastHit).get_point().y;
            ((Component)player.Locomotor).get_transform().set_position(locatedPosition);
            ActorAnimInfo animInfo = player.Animation.AnimInfo;

            player.SetStand(player.Animation.RecoveryPoint, animInfo.endEnableBlend, animInfo.endBlendSec, animInfo.directionType);
            player.Animation.RefsActAnimInfo = true;
            player.ClearItems();
            player.ClearParticles();
            player.Partner?.ClearItems();
            player.Partner?.ClearParticles();
        }
Exemplo n.º 11
0
        protected override void OnRelease(PlayerActor player)
        {
            player.CameraControl.EventCameraLocator.set_runtimeAnimatorController((RuntimeAnimatorController)null);
            // ISSUE: cast to a reference type
            // ISSUE: explicit reference operation
            (^ (CinemachineBlendDefinition&)ref player.CameraControl.CinemachineBrain.m_DefaultBlend).m_Style = (__Null)this._prevStyle;
            player.CameraControl.Mode    = CameraMode.Normal;
            player.ChaControl.visibleAll = true;
            if (Object.op_Inequality((Object)this._agent, (Object)null))
            {
                AssetBundleInfo outInfo = (AssetBundleInfo)null;
                this._agent.ChangeAnimator(Singleton <Resources> .Instance.Animation.GetCharaAnimator(0, ref outInfo));
                if (!this._registeredBefore)
                {
                    this._agent.RefreshWalkStatus(Singleton <Manager.Map> .Instance.PointAgent.Waypoints);
                    Singleton <Manager.Map> .Instance.InitSearchActorTargets(this._agent);

                    player.PlayerController.CommandArea.AddCommandableObject((ICommandable)this._agent);
                    using (IEnumerator <KeyValuePair <int, AgentActor> > enumerator = Singleton <Manager.Map> .Instance.AgentTable.GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            KeyValuePair <int, AgentActor> current = enumerator.Current;
                            if (!Object.op_Equality((Object)current.Value, (Object)this._agent))
                            {
                                current.Value.AddActor((Actor)this._agent);
                            }
                        }
                    }
                }
                this._agent.ClearItems();
                this._agent.ClearParticles();
                this._agent.ActivateNavMeshAgent();
                this._agent.EnableBehavior();
                this._agent.ChangeBehavior(Desire.ActionType.Normal);
            }
            Singleton <Manager.Input> .Instance.ReserveState(Manager.Input.ValidType.Action);

            Singleton <Manager.Input> .Instance.SetupState();

            player.SetScheduledInteractionState(true);
            player.ReleaseInteraction();
        }
Exemplo n.º 12
0
        protected override void OnAwake(PlayerActor player)
        {
            Singleton <MapScene> .Instance.SaveProfile(true);

            Singleton <Input> .Instance.ReserveState(Input.ValidType.UI);

            Singleton <Input> .Instance.SetupState();

            MapUIContainer.SetVisibleHUDExceptStoryUI(false);
            MapUIContainer.StorySupportUI.Close();
            if (MapUIContainer.OpenOnceTutorial(6, false))
            {
                MapUIContainer.TutorialUI.ClosedEvent = (Action)(() => this.OnStart(player));
            }
            else
            {
                this.OnStart(player);
            }
        }
Exemplo n.º 13
0
        public bool CheckPlayerOnFarSearchArea()
        {
            PlayerActor player = this.Player;
            ValueTuple <CollisionState, Actor> valueTuple;

            if (!Object.op_Implicit((Object)player) || !this.farCollisionStateTable.TryGetValue(player.InstanceID, out valueTuple))
            {
                return(false);
            }
            switch ((CollisionState)valueTuple.Item1)
            {
            case CollisionState.Enter:
            case CollisionState.Stay:
                return(true);

            default:
                return(false);
            }
        }
Exemplo n.º 14
0
        private AttackState(PlayerActor actor, int comboCount) : base(actor)
        {
            ComboCount = comboCount;
            switch (ComboCount)
            {
            case 2:
                _setting = PlayerSettings.Attack3;
                break;

            case 1:
                _setting = PlayerSettings.Attack2;
                break;

            // case 0:
            default:
                _setting = PlayerSettings.Attack1;
                break;
            }
        }
Exemplo n.º 15
0
    public IEnumerator ApplyActionsRoutine(PlayerActor owner, PlayerActor target)
    {
        //Debug.Log ("Apply");

        int ownerIndex = GetComponentInParent <CardHand> ().playerIndex;

        foreach (var a in actions)
        {
            var createdAction = GameObject.Instantiate <CardAction> (a);
            createdAction.Apply(owner, target);

            while (createdAction.done == false)
            {
                yield return(new WaitForFixedUpdate());
            }

            GameObject.Destroy(createdAction.gameObject);
        }
    }
Exemplo n.º 16
0
        protected override void OnAwake(PlayerActor player)
        {
            Singleton <MapScene> .Instance.SaveProfile(true);

            Singleton <Input> .Instance.ReserveState(Input.ValidType.UI);

            Singleton <Input> .Instance.SetupState();

            MapUIContainer.SetVisibleHUDExceptStoryUI(false);
            MapUIContainer.StorySupportUI.Close();
            MapUIContainer.RefreshCommands(0, player.ShipCommandInfos);
            MapUIContainer.CommandList.CancelEvent = (Action)(() =>
            {
                MapUIContainer.SetActiveCommandList(false);
                MapUIContainer.StorySupportUI.Open();
                player.PlayerController.ChangeState("Normal");
            });
            MapUIContainer.SetActiveCommandList(true, "移動先");
        }
Exemplo n.º 17
0
    private void GiveUpgrade(PlayerActor player)
    {
        _onPickUpCue?.Play();
        // Get weapons
        WeaponsController playerWeapons = player.GetComponent <WeaponsController>();

        if (Hand)
        {
            playerWeapons.Right.UpgradeWeapon(_rightWeaponUpgrade);
        }
        else
        {
            playerWeapons.Left.UpgradeWeapon(_leftWeaponUpgrade);
        }


        Active = false;
        _upgradeParticleSystem?.gameObject.SetActive(false);
    }
Exemplo n.º 18
0
    public void BiteOrSteal(PlayerActor activeActor, GameObject target)
    {
        if (target.GetComponent <PushableActor>())
        {
            _activeAbility = Push;
            Armed(activeActor, target);
            AnimationController.Move();
        }
        else
        {
            if (target == activeActor)
            {
                return;
            }

            _activeAbility = Pick;
            Armed(activeActor, target);
        }
    }
Exemplo n.º 19
0
        private static void CreateList(
            AgentActor agent,
            List <ActionPoint> source,
            List <ActionPoint> destination)
        {
            PlayerActor            player             = Singleton <Manager.Map> .Instance.Player;
            int                    searchCount        = Singleton <Manager.Map> .Instance.EnvironmentProfile.SearchCount;
            float                  meshSampleDistance = Singleton <Resources> .Instance.LocomotionProfile.ActionPointNavMeshSampleDistance;
            Dictionary <int, bool> toRelease          = DictionaryPool <int, bool> .Get();

            int hizamakuraID = Singleton <Resources> .Instance.PlayerProfile.HizamakuraPTID;

            foreach (ActionPoint actionPoint in source)
            {
                if (!Object.op_Equality((Object)actionPoint, (Object)null) && !Object.op_Equality((Object)actionPoint.OwnerArea, (Object)null) && (actionPoint.IsNeutralCommand && !actionPoint.IsReserved(agent)))
                {
                    MapArea ownerArea = actionPoint.OwnerArea;
                    bool    flag;
                    if (!toRelease.TryGetValue(ownerArea.AreaID, out flag))
                    {
                        toRelease[ownerArea.AreaID] = flag = Singleton <Manager.Map> .Instance.CheckAvailableMapArea(ownerArea.AreaID);
                    }
                    if (flag)
                    {
                        EventType eventType = actionPoint.PlayerDateEventType[(int)Singleton <Manager.Map> .Instance.Player.ChaControl.sex];
                        if (!actionPoint.IDList.IsNullOrEmpty <int>() && ((IEnumerable <int>)actionPoint.IDList).Any <int>((Func <int, bool>)(x => x == hizamakuraID)) || actionPoint.IDList.IsNullOrEmpty <int>() && actionPoint.ID == hizamakuraID)
                        {
                            if (ExistsHizamakura._navMeshPath == null)
                            {
                                ExistsHizamakura._navMeshPath = new NavMeshPath();
                            }
                            NavMeshHit navMeshHit;
                            if (agent.NavMeshAgent.CalculatePath(actionPoint.LocatedPosition, ExistsHizamakura._navMeshPath) && ExistsHizamakura._navMeshPath.get_status() == null && NavMesh.SamplePosition(actionPoint.LocatedPosition, ref navMeshHit, meshSampleDistance, agent.NavMeshAgent.get_areaMask()))
                            {
                                destination.Add(actionPoint);
                            }
                        }
                    }
                }
            }
            DictionaryPool <int, bool> .Release(toRelease);
        }
 private void Awake()
 {
     ObservableExtensions.Subscribe <long>(Observable.Take <long>(Observable.SkipWhile <long>(Observable.TakeUntilDestroy <long>((IObservable <M0>)Observable.EveryUpdate(), (Component)this), (Func <M0, bool>)(_ => Object.op_Equality((Object)Manager.Map.GetCameraComponent(), (Object)null))), 1), (Action <M0>)(_ =>
     {
         if (!Singleton <Manager.Map> .IsInstance())
         {
             return;
         }
         this._player = Manager.Map.GetPlayer();
         this._camera = Manager.Map.GetCameraComponent(this._player);
         if (!Object.op_Inequality((Object)this._player, (Object)null) || !Object.op_Inequality((Object)this._camera, (Object)null))
         {
             return;
         }
         ObservableExtensions.Subscribe <long>(Observable.TakeUntilDestroy <long>(Observable.TakeUntilDestroy <long>(Observable.TakeUntilDestroy <long>((IObservable <M0>)Observable.EveryUpdate(), (Component)this), (Component)this._player), (Component)this._camera), (Action <M0>)(__ => this.OnUpdate()));
         ObservableExtensions.Subscribe <long>(Observable.TakeUntilDestroy <long>(Observable.TakeUntilDestroy <long>(Observable.TakeUntilDestroy <long>((IObservable <M0>)Observable.Interval(TimeSpan.FromSeconds((double)this._elmRefreshInterval)), (Component)this), (Component)this._player), (Component)this._camera), (Action <M0>)(__ =>
         {
             this._elmList.RemoveAll((Predicate <INicknameObject>)(x => x == null));
             this._showList.RemoveAll((Predicate <INicknameObject>)(x => x == null));
             this._hideList.RemoveAll((Predicate <INicknameObject>)(x => x == null));
             List <int> toRelease = ListPool <int> .Get();
             using (Dictionary <int, ValueTuple <INicknameObject, AnimalNicknameUI> > .Enumerator enumerator = this._showTable.GetEnumerator())
             {
                 while (enumerator.MoveNext())
                 {
                     KeyValuePair <int, ValueTuple <INicknameObject, AnimalNicknameUI> > current = enumerator.Current;
                     ValueTuple <INicknameObject, AnimalNicknameUI> valueTuple = current.Value;
                     if (valueTuple.Item1 == null)
                     {
                         this.ReturnUI((AnimalNicknameUI)valueTuple.Item2);
                         toRelease.Add(current.Key);
                     }
                 }
             }
             foreach (int num in toRelease)
             {
                 toRelease.Remove(num);
             }
             ListPool <int> .Release(toRelease);
         }));
     }));
 }
Exemplo n.º 21
0
        private bool CanAction(PlayerActor player, EventType eventType, int searchAreaID)
        {
            int registerId = this.RegisterID;
            Dictionary <int, AIProject.SaveData.Environment.SearchActionInfo> searchActionLockTable = Singleton <Game> .Instance.Environment.SearchActionLockTable;

            AIProject.SaveData.Environment.SearchActionInfo searchActionInfo1;
            if (!searchActionLockTable.TryGetValue(registerId, out searchActionInfo1))
            {
                AIProject.SaveData.Environment.SearchActionInfo searchActionInfo2 = new AIProject.SaveData.Environment.SearchActionInfo();
                searchActionLockTable[registerId] = searchActionInfo2;
                searchActionInfo1 = searchActionInfo2;
            }
            if (searchActionInfo1.Count >= Singleton <Manager.Map> .Instance.EnvironmentProfile.SearchCount || player.PlayerData.ItemList.Count >= player.PlayerData.InventorySlotMax)
            {
                return(false);
            }
            StuffItem itemInfo = player.PlayerData.EquipedSearchItem(searchAreaID);

            return(this.CanSearch(eventType, itemInfo));
        }
Exemplo n.º 22
0
        protected override void OnAwake(PlayerActor player)
        {
            player.SetActiveOnEquipedItem(false);
            player.ChaControl.setAllLayerWeight(0.0f);
            player.ChaControl.visibleAll = false;
            MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.None);
            player.SetScheduledInteractionState(false);
            player.ReleaseInteraction();
            ActorAnimInfo animInfo = player.Animation.AnimInfo;

            animInfo.outBlendSec      = 0.0f;
            animInfo.outEnableBlend   = true;
            player.Animation.AnimInfo = animInfo;
            if (!Object.op_Inequality((Object)player.CommCompanion, (Object)null))
            {
                return;
            }
            player.CommCompanion.Animation.BeginIgnoreExpression();
            player.CommCompanion.Animation.BeginIgnoreVoice();
        }
Exemplo n.º 23
0
        private void Start()
        {
            _player = GameSettings.Instance.PlayerSettings;

            // without the PlayerActor scriptableobject there
            // is no defined parameters for the player movement
            if (!_player)
            {
                Debug.LogError("No " + typeof(PlayerActor) + " found. " +
                               "Disabling script...");
                enabled = false;
            }

            // neccesary components for the script to work
            this.GetNeededComponent(ref _rigidbody);
            this.GetNeededComponent(ref _state);
            this.GetNeededComponent(ref _animator);
            // get animator parameters ids
            _animFlattenSpeed = Animator.StringToHash("FlattenSpeed");
        }
Exemplo n.º 24
0
 private void ChangeAbductMode(AgentActor agent, PlayerActor player, Desire.ActionType mode)
 {
     player.CameraControl.Mode            = CameraMode.Normal;
     player.CameraControl.OnCameraBlended = (System.Action)(() => Singleton <Manager.Map> .Instance.Player.ChaControl.visibleAll = player.CameraControl.ShotType != ShotType.PointOfView);
     agent.Animation.ResetDefaultAnimatorController();
     agent.Partner = (Actor)player;
     if (Object.op_Inequality((Object)player.Partner, (Object)null))
     {
         AgentActor partner = player.Partner as AgentActor;
         if (Object.op_Inequality((Object)partner, (Object)null))
         {
             partner.DeactivatePairing(0);
         }
     }
     player.Partner = (Actor)agent;
     player.PlayerController.ChangeState("Follow");
     ObservableExtensions.Subscribe <long>(Observable.Take <long>(Observable.SkipWhile <long>((IObservable <M0>)Observable.EveryUpdate(), (Func <M0, bool>)(_ => MapUIContainer.ChoiceUI.IsActiveControl)), 1), (System.Action <M0>)(_ => MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.None)));
     agent.DestPosition = new Vector3?();
     agent.ChangeBehavior(mode);
 }
Exemplo n.º 25
0
 private void StartChange(PlayerActor player)
 {
     ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndFadeIn, 1), (Action <M0>)(_ =>
     {
         this.Refresh(player);
         ObservableExtensions.Subscribe <Unit>(Observable.Take <Unit>((IObservable <M0>) this._onEndFadeOut, 1), (Action <M0>)(__ =>
         {
             player.CurrentDevicePoint = (DevicePoint)null;
             MapUIContainer.SetVisibleHUDExceptStoryUI(true);
             MapUIContainer.StorySupportUI.Open();
             player.Controller.ChangeState("Normal");
             Singleton <Input> .Instance.ReserveState(Input.ValidType.Action);
             Singleton <Input> .Instance.SetupState();
             player.SetScheduledInteractionState(true);
             player.ReleaseInteraction();
         }));
         ObservableExtensions.Subscribe <long>((IObservable <M0>)Observable.Timer(TimeSpan.FromMilliseconds(100.0)), (Action <M0>)(__ => ObservableExtensions.Subscribe <Unit>((IObservable <M0>)MapUIContainer.StartFade(FadeCanvas.PanelType.Blackout, (global::FadeType)1, 1f, false), (Action <M0>)(___ => {}), (Action)(() => this._onEndFadeOut.OnNext(Unit.get_Default())))));
     }));
     ObservableExtensions.Subscribe <Unit>((IObservable <M0>)MapUIContainer.StartFade(FadeCanvas.PanelType.Blackout, (global::FadeType)0, 1f, true), (Action <M0>)(_ => {}), (Action)(() => this._onEndFadeIn.OnNext(Unit.get_Default())));
 }
Exemplo n.º 26
0
        protected override void OnRelease(PlayerActor player)
        {
            Singleton <Manager.Input> .Instance.ReserveState(Manager.Input.ValidType.Action);

            Singleton <Manager.Input> .Instance.SetupState();

            player.SetScheduledInteractionState(true);
            player.ReleaseInteraction();
            player.ClearParticles();
            player.Partner?.ClearParticles();
            if (this._onEndActionDisposable != null)
            {
                this._onEndActionDisposable.Dispose();
            }
            if (this._onEndInAnimDisposable == null)
            {
                return;
            }
            this._onEndInAnimDisposable.Dispose();
        }
Exemplo n.º 27
0
 protected override void OnRelease(PlayerActor player)
 {
     switch (player.PlayerController.State)
     {
     case Normal _:
     case Onbu _:
         this._prevAcceptionState = CommandLabel.AcceptionState.InvokeAcception;
         break;
     }
     player.NavMeshAgent.set_avoidancePriority(this._prevAvoidancePriority);
     if (Object.op_Inequality((Object)player.Partner, (Object)null))
     {
         player.Partner.NavMeshAgent.set_obstacleAvoidanceType((ObstacleAvoidanceType)4);
     }
     if (this._prevAcceptionState == MapUIContainer.CommandLabel.Acception)
     {
         return;
     }
     MapUIContainer.SetCommandLabelAcception(this._prevAcceptionState);
 }
Exemplo n.º 28
0
        private void EndState(PlayerActor player)
        {
            StuffItem     equipedLampItem = player.PlayerData.EquipedLampItem;
            ItemIDKeyPair torchId         = Singleton <Resources> .Instance.CommonDefine.ItemIDDefine.TorchID;
            ItemIDKeyPair maleLampId      = Singleton <Resources> .Instance.CommonDefine.ItemIDDefine.MaleLampID;
            ItemIDKeyPair flashlightId    = Singleton <Resources> .Instance.CommonDefine.ItemIDDefine.FlashlightID;

            if (equipedLampItem.CategoryID == torchId.categoryID && equipedLampItem.ID == torchId.itemID || equipedLampItem.CategoryID == maleLampId.categoryID && equipedLampItem.ID == maleLampId.itemID || equipedLampItem.CategoryID == flashlightId.categoryID && equipedLampItem.ID == flashlightId.itemID)
            {
                player.CameraControl.CrossFade.FadeStart(-1f);
            }
            if (player.PlayerController.PrevStateName == "Onbu")
            {
                player.PlayerController.ChangeState("Onbu");
            }
            else
            {
                player.PlayerController.ChangeState("Normal");
            }
        }
Exemplo n.º 29
0
        private bool CheckChange(PlayerActor player)
        {
            WorldData worldData = Singleton <Game> .Instance.WorldData;

            Singleton <Manager.Map> .Instance.ChangedCharaFiles.Clear();

            foreach (KeyValuePair <int, AgentData> keyValuePair in worldData.AgentTable)
            {
                if (this._agentCharaFiles[keyValuePair.Key] != keyValuePair.Value.CharaFileName || this._agentCharaMapIDs[keyValuePair.Key] != keyValuePair.Value.MapID)
                {
                    Singleton <Manager.Map> .Instance.ChangedCharaFiles[keyValuePair.Key] = keyValuePair.Value.CharaFileName;
                }
            }
            if (Singleton <Manager.Map> .Instance.ChangedCharaFiles.Count <= 0)
            {
                return(false);
            }
            player.Controller.ChangeState("CharaChange");
            return(true);
        }
Exemplo n.º 30
0
        protected override void OnAwake(PlayerActor player)
        {
            this._currentFarmPoint = player.CurrentFarmPoint;
            if (Object.op_Equality((Object)this._currentFarmPoint, (Object)null))
            {
                player.PlayerController.ChangeState("Normal");
            }
            else
            {
                this._input = Singleton <Input> .Instance;
                Input.ValidType state = this._input.State;
                this._input.ReserveState(Input.ValidType.UI);
                this._input.SetupState();
                this._input.ReserveState(state);
                MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.None);
                MapUIContainer.SetVisibleHUD(false);
                int registerId = this._currentFarmPoint.RegisterID;
                List <AIProject.SaveData.Environment.ChickenInfo> chickenInfoList1 = (List <AIProject.SaveData.Environment.ChickenInfo>)null;
                Dictionary <int, List <AIProject.SaveData.Environment.ChickenInfo> > dictionary = !Singleton <Game> .IsInstance() ? (Dictionary <int, List <AIProject.SaveData.Environment.ChickenInfo> >)null : Singleton <Game> .Instance.Environment?.ChickenTable;

                if (dictionary != null && (!dictionary.TryGetValue(registerId, out chickenInfoList1) || chickenInfoList1 == null))
                {
                    List <AIProject.SaveData.Environment.ChickenInfo> chickenInfoList2 = new List <AIProject.SaveData.Environment.ChickenInfo>();
                    dictionary[registerId] = chickenInfoList2;
                    chickenInfoList1       = chickenInfoList2;
                }
                if (chickenInfoList1 == null)
                {
                    chickenInfoList1 = new List <AIProject.SaveData.Environment.ChickenInfo>();
                }
                MapUIContainer.ChickenCoopUI.currentChickens = chickenInfoList1;
                MapUIContainer.ChickenCoopUI.ClosedEvent     = (Action)(() => MapUIContainer.CommandList.Visibled = true);
                MapUIContainer.RefreshCommands(0, player.ChickenCoopCommandInfos);
                MapUIContainer.CommandList.CancelEvent = (Action)(() =>
                {
                    MapUIContainer.SetActiveCommandList(false);
                    player.PlayerController.ChangeState("Normal");
                });
                MapUIContainer.SetActiveCommandList(true, "鶏小屋");
            }
        }
Exemplo n.º 31
0
        public void LoadHousingVanish(PlayerActor player)
        {
            if (!Object.op_Inequality((Object)Singleton <Manager.Map> .Instance.PointAgent, (Object)null))
            {
                return;
            }
            BasePoint[] basePoints = Singleton <Manager.Map> .Instance.PointAgent.BasePoints;
            if (basePoints == null)
            {
                return;
            }
            int mapId  = Singleton <Manager.Map> .Instance.MapID;
            int index1 = -1;
            Dictionary <int, Dictionary <int, List <int> > > housingAreaGroup = Singleton <Resources> .Instance.Map.VanishHousingAreaGroup;

            if (housingAreaGroup == null || !housingAreaGroup.ContainsKey(mapId))
            {
                return;
            }
            foreach (KeyValuePair <int, List <int> > keyValuePair in housingAreaGroup[mapId])
            {
                if (keyValuePair.Value.Contains(player.AreaID))
                {
                    index1 = keyValuePair.Key;
                    break;
                }
            }
            if (index1 < 0)
            {
                return;
            }
            for (int index2 = 0; index2 < basePoints.Length; ++index2)
            {
                if (!Object.op_Equality((Object)basePoints[index2].OwnerArea, (Object)null) && housingAreaGroup[mapId][index1].Contains(basePoints[index2].OwnerArea.AreaID) && basePoints[index2].ID >= 0)
                {
                    Singleton <Housing> .Instance.StartShield(basePoints[index2].ID);

                    break;
                }
            }
        }
Exemplo n.º 32
0
        private void PlayCloseSE(PlayerActor player, Transform playRoot)
        {
            if (Object.op_Equality((Object)player, (Object)null) || Singleton <Resources> .IsInstance())
            {
                return;
            }
            if (Object.op_Equality((Object)playRoot, (Object)null))
            {
                playRoot = ((Component)player.Locomotor).get_transform();
            }
            SoundPack.DoorSEIDInfo doorSeidInfo;
            if (!Singleton <Resources> .Instance.SoundPack.DoorIDTable.TryGetValue(DoorMatType.Capsule, out doorSeidInfo))
            {
                return;
            }
            AudioSource audioSource = Singleton <Resources> .Instance.SoundPack.Play(doorSeidInfo.CloseID, Sound.Type.GameSE3D, 0.0f);

            audioSource.Stop();
            ((Component)audioSource).get_transform().SetPositionAndRotation(playRoot.get_position(), playRoot.get_rotation());
            audioSource.Play();
        }
Exemplo n.º 33
0
 private void OnStart(PlayerActor player)
 {
     MapUIContainer.RefreshCommands(0, player.CookCommandInfos);
     MapUIContainer.CommandList.CancelEvent = (Action)(() =>
     {
         Singleton <Resources> .Instance.SoundPack.Play(SoundPack.SystemSE.Cancel);
         MapUIContainer.SetActiveCommandList(false);
         MapUIContainer.SetVisibleHUDExceptStoryUI(true);
         MapUIContainer.StorySupportUI.Open();
         player.Controller.ChangeState("Normal");
         player.ReleaseCurrentPoint();
         if (Object.op_Inequality((Object)player.PlayerController.CommandArea, (Object)null))
         {
             ((Behaviour)player.PlayerController.CommandArea).set_enabled(true);
         }
         MapUIContainer.SetCommandLabelAcception(CommandLabel.AcceptionState.InvokeAcception);
         player.ActivateNavMeshAgent();
         player.IsKinematic = false;
     });
     MapUIContainer.SetActiveCommandList(true, "料理");
 }
Exemplo n.º 34
0
 //获取Station类型的PlayerActor
 public void GetStationPlayerActorAboutU3DPlayerActor(PlayerActor u3dPlayerActor, UInt16 stationIndex, List <PlayerActor> stationPlayerActorList)
 {
     if (stationPlayerActorList == null)
     {
         return;
     }
     if (m_worldActor != null)
     {
         string      keyStr      = "";
         PlayerActor playerActor = null;
         for (int i = 1; i <= 4; i++)
         {
             keyStr      = string.Format("{0}-{1}-{2}", u3dPlayerActor.U3DId, stationIndex, 1);
             playerActor = m_worldActor.GetStationPlayerActor(keyStr);
             if (playerActor != null)
             {
                 stationPlayerActorList.Add(playerActor);
             }
         }
     }
 }
Exemplo n.º 35
0
 void Start()
 {
     playerActor = GetComponent<PlayerActor>();
     deltaTime = Time.deltaTime;
 }
Exemplo n.º 36
0
//	protected virtual void Update()
//	{
//		//check current game state
//		switch (GameManager.instance.GameState)
//		{
//		case GameStates.gameplay:
//			Tick();
//			break;
//		case GameStates.gamepause:
//			break;
//		case GameStates.debug:
//			Tick();
//			break;
//		case GameStates.menu:
//			break;
//		}
//		base.Update ();
//	}

	public virtual void Init(PlayerActor prevPlayer)
	{
		base.Init();
	}
    public void UpdateItemTarget(PlayerActor currentPlayer, int currentIndex)
    {
        m_currentPlayer = currentPlayer;
        m_currentItemIndex = currentIndex;

        m_putLabel.passive 	 = !m_currentPlayer.CanPutItemOnGround(currentIndex);
        m_throwLabel.passive = !m_currentPlayer.CanThrowItem(currentIndex);
        m_equipLabel.passive = !m_currentPlayer.CanEquipItem(currentIndex);
        //m_useLabel.passive 	 = !m_currentPlayer.CanUseItem(currentIndex);

        string uselabel = null;
        if( m_currentPlayer.CanEquipItem(currentIndex) ) {
            uselabel = m_currentPlayer.IsEquippingItem(currentIndex) ? "はずす" : "そうび";
            m_useLabel.passive = false;
        }
        else if(m_currentPlayer.CanEatItem(currentIndex)) {
            uselabel = "たべる";
            m_useLabel.passive = false;
        }
        else {
            uselabel = "つかう";
            m_useLabel.passive = !m_currentPlayer.CanUseItem(currentIndex);
        }

        m_useLabel.label.text = uselabel;

        // TODO:
        m_equipLabel.label.text = "";
        m_equipLabel.passive = true;
    }