protected Node GetDrink(SmartCharacter user) { return new Sequence( user.Node_Require(StateName.RoleActor, StateName.IsStanding, ~StateName.RightHandOccupied, ~StateName.IsIncapacitated), this.Node_Require(StateName.RoleDispenser), user.Node_GoTo(this.StandPoint.position), user.Node_OrientTowards(this.DrinkButton.transform.position), new DecoratorCatch( () => //if terminates, make sure the right hand interaction and headlook is stopped { user.Character.StopInteraction(FullBodyBipedEffector.RightHand); user.Character.HeadLookStop(); }, new Sequence( user.Node_StartInteraction(FullBodyBipedEffector.RightHand, this.DrinkButton), user.Node_WaitForTrigger(FullBodyBipedEffector.RightHand), new SequenceParallel( //user.Node_HeadLook(this.DrinkPickup.transform.position), user.Node_OrientTowards(this.DrinkPickup.transform.position)), user.Node_StopInteraction(FullBodyBipedEffector.RightHand), new LeafWait(1000), new LeafInvoke(() => GenerateDrink()), new LeafWait(500))), user.ST_Pickup(DrinkHolder, DrinkPickup), user.Node_Set(StateName.HoldingDrink, StateName.RightHandOccupied), user.Node_GoTo(this.LeavePoint.position)); }
protected Node GetTicket(SmartCharacter user) { return new Sequence( new LeafInvoke(() => GenerateTicket()), user.Node_GoTo(StandPoint.position), user.Node_OrientTowards(TicketHolder.transform.position), user.ST_Pickup(TicketHolder, InteractionTake), new DecoratorCatch( () => GameObject.Destroy(user.HoldPropRightHand.CurrentProp.gameObject), user.Node_GoTo(rect.RandomPoint(GoToEdge1.position.y))), new LeafInvoke(() => GameObject.Destroy(user.HoldPropRightHand.CurrentProp.gameObject))); }
protected Node TellerPutHidden(SmartCharacter user) { return new Sequence( user.Node_GoTo(TellerStandPoint.position), user.Node_OrientTowards(CustomerStandPoint.position), user.ST_Pickup(HoldPropIntermediate, InteractionIntermediateTeller), new LeafInvoke(() => user.GetRightProp().FadeOut()), user.ST_Put(HoldPropStorage, InteractionStorage)); }
protected Node TellerPutMoney(SmartCharacter user) { return new Sequence( this.Node_Require(StateName.RoleTeller, StateName.HoldingWallet), user.Node_Require(StateName.RoleTeller, StateName.IsStanding, ~StateName.RightHandOccupied, ~StateName.IsIncapacitated), this.Node_Require(user.Id, RelationName.IsAdjacentTo), user.Node_GoTo(TellerStandPoint.position), user.Node_OrientTowards(CustomerStandPoint.position), user.ST_Pickup(HoldPropIntermediate, InteractionIntermediateTeller), user.ST_Put(HoldPropStorage, InteractionStorage), this.Node_Set(~StateName.HoldingWallet)); }
protected Node CustomerTakeMoney(SmartCharacter user) { return new Sequence( this.Node_Require(StateName.RoleTeller), user.Node_Require(StateName.RoleActor, StateName.IsStanding, ~StateName.RightHandOccupied, ~StateName.HoldingWallet, ~StateName.IsIncapacitated), user.ST_Pickup(HoldPropIntermediate, InteractionIntermediateCustomer), user.ST_PutWalletInPocket(), user.Node_Set(StateName.HoldingWallet)); }