Beispiel #1
0
 protected Node FillOutForm(SmartCharacter user)
 {
     Vector3 oldPosition = new Vector3();
     return new Sequence(
         user.Node_Require(StateName.RoleActor, StateName.IsStanding, ~StateName.IsIncapacitated, ~StateName.RightHandOccupied),
         this.Node_Require(StateName.RoleTable, ~StateName.HoldingBall, ~StateName.HoldingWallet),
         new LeafInvoke(() => oldPosition = user.transform.position),
         new Race(
             new Sequence(
                 new LeafWait(15000),
                 new LeafInvoke(() => RunStatus.Failure)),
             user.ST_StandAtWaypoint(this.StandPoint)),
         user.Node_NudgeTo(Val.V(() => this.StandPoint.position)),
         new LeafInvoke(() => user.transform.rotation = this.StandPoint.rotation),
         new LeafInvoke(() => user.HoldPropRightHand.Attach(user.HoldPropHidden.Release())),
         new LeafInvoke(() => user.GetRightProp().FadeIn()),
         user.Node_StartInteraction(FullBodyBipedEffector.RightHand, this.PropPickup),
         user.Node_WaitForTrigger(FullBodyBipedEffector.RightHand),
         new LeafInvoke(() => this.PropHolder.Attach(user.HoldPropRightHand.Release())),
         user.Node_StopInteraction(FullBodyBipedEffector.RightHand),
         user.Behavior.ST_PlayHandGesture("writing", 6000),
         user.Node_StartInteraction(FullBodyBipedEffector.RightHand, this.PropPickup),
         user.Node_WaitForTrigger(FullBodyBipedEffector.RightHand),
         new LeafInvoke(() => user.HoldPropRightHand.Attach(this.PropHolder.Release())),
         user.Node_StopInteraction(FullBodyBipedEffector.RightHand),
         new LeafWait(500),
         new LeafInvoke(() => user.GetRightProp().FadeOut()),
         new LeafWait(500),
         new LeafInvoke(() => user.HoldPropHidden.Attach(user.HoldPropRightHand.Release())),
         user.Node_GoTo(Val.V(() => oldPosition)));
 }
Beispiel #2
0
 protected Node PickupWeapon(SmartCharacter user)
 {
     return new Sequence(
         new Selector(
             new Sequence(
                 new LeafAssert(() => (user.transform.position - this.transform.position).magnitude < 1.0f),
                 new LeafInvoke(() => user.Character.NavStop())),
             user.Node_GoToUpToRadius(Val.V(() => this.transform.position), 1.0f)),
         user.Node_OrientTowards(Val.V(() =>this.transform.position)),
         user.Node_StartInteraction(FullBodyBipedEffector.RightHand, this.InteractionTakeGun),
         new LeafWait(500),
         new LeafInvoke(() => this.Holder.CurrentProp.FadeOut()),
         new LeafWait(500),
         new LeafInvoke(() => user.HoldPropRightHand.Attach(this.Holder.Release())),
         new LeafInvoke(() => user.GetRightProp().FadeIn()),
         user.Node_StopInteraction(FullBodyBipedEffector.RightHand),
         new LeafWait(1000),
         this.Node_Set(~StateName.HoldingWeapon, ~StateName.IsOccupied),
         user.Node_Set(StateName.HoldingWeapon, StateName.RightHandOccupied));
 }
Beispiel #3
0
 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));
 }
Beispiel #4
0
 protected Node CustomerPutHidden(SmartCharacter user)
 {
     return new Sequence(
         new LeafInvoke(() => user.HoldPropRightHand.Attach(user.HoldPropHidden.Release())),
         new LeafInvoke(() => user.GetRightProp().FadeIn()),
         user.ST_Put(HoldPropIntermediate, InteractionIntermediateCustomer));
 }
Beispiel #5
0
 protected Node GetGunIncapacitated(SmartCharacter user)
 {
     return new Sequence(
         user.ST_StandAtWaypoint(this.WaypointPickupGun),
         user.Node_StartInteraction(FullBodyBipedEffector.RightHand, this.InteractionGetGunIncapacitated),
         new LeafWait(500),
         new LeafInvoke(() => this.GetRightProp().FadeOut()),
         new LeafWait(500),
         new LeafInvoke(() => user.HoldPropRightHand.Attach(this.HoldPropRightHand.Release())),
         new LeafInvoke(() => user.GetRightProp().FadeIn()),
         user.Node_StopInteraction(FullBodyBipedEffector.RightHand),
         this.Node_Set(~StateName.RightHandOccupied, ~StateName.HoldingWeapon),
         user.Node_Set(StateName.RightHandOccupied, StateName.HoldingWeapon),
         new LeafWait(1000));
 }
Beispiel #6
0
 protected Node TeleportDropWeapon(SmartCharacter user)
 {
     return new Sequence(
         user.Node_StartInteraction(FullBodyBipedEffector.RightHand, user.InteractionDropGun),
         new LeafWait(500),
         new LeafInvoke(() => user.GetRightProp().FadeOut()),
         new LeafWait(500),
         new LeafInvoke(() => this.SetReceivePosition(user)),
         new LeafInvoke(() => this.Holder.Attach(user.HoldPropRightHand.Release())),
         new LeafInvoke(() => this.ContainedProp.FadeIn()),
         new LeafWait(500),
         user.Node_StopInteraction(FullBodyBipedEffector.RightHand),
         this.Node_Set(StateName.HoldingWeapon, StateName.IsOccupied),
         user.Node_Set(~StateName.HoldingWeapon, ~StateName.RightHandOccupied));
 }
Beispiel #7
0
 private void SetReceivePosition(SmartCharacter holder)
 {
     Transform propTrans = holder.GetRightProp().transform;
     Vector3 propPos = propTrans.position;
     float y = holder.transform.position.y;
     this.transform.position = new Vector3(propPos.x, y, propPos.z);
     float yAngle = propTrans.rotation.eulerAngles.y;
     Vector3 currentAngles = transform.rotation.eulerAngles;
     this.transform.rotation = 
         Quaternion.Euler(
             new Vector3(
                 currentAngles.x,
                 yAngle,
                 currentAngles.z));
 }