Exemplo n.º 1
0
        public void EnterBuilding(Building target)
        {
            target.PeopleInside.Add(Self.gameObject);

            Self.inBuilding      = true;
            Self.CurrentSubState = SubState.Waiting;

            Self.SetPersonActive(false);
            isBusy = false;
        }
Exemplo n.º 2
0
        public ExtortPersonAction(CitizenBehaviour self, CitizenBehaviour target)
        {
            Self            = self;
            ActionCompleted = false;
            try{
                CurrentActionTarget = target.gameObject;
            }
            catch (System.Exception) {
                MonoBehaviour.Destroy(self.gameObject);
            }
            ObjectiveRange = 0.15f;

            //Make sure all citizens spawn inside houses, and then moves out
            Self.SetPersonActive(true);

            targetStatsScript = CurrentActionTarget.GetComponent <CitizenStats> ();
            targetScript      = target as Citizen_Civilian;
            targetPosition    = CurrentActionTarget.transform.GetChild(0).GetChild(0);

            animator = Self.anim;

            //Change this to a "chasing" system. Also in the talk action
            //ForceTargetToHalt ();

            Gunparticle = Self.transform.GetChild(0).GetChild(0).GetChild(1).GetComponentInChildren <ParticleSystem> ();

            ExecuteAction();
        }
Exemplo n.º 3
0
        public HealPerson(CitizenBehaviour self, GameObject target)
        {
            Self            = self;
            paramedicScript = Self as Citizen_PublicServant_Paramedic;
            ActionCompleted = false;
            try{
                if (target == null)
                {
                    GetNewTarget();
                }

                CurrentActionTarget = target;
                ObjectiveRange      = 0.15f;

                targetScript   = CurrentActionTarget.GetComponent <CitizenBehaviour> ();
                targetPosition = CurrentActionTarget.transform.GetChild(0).GetChild(0);


                Self.SetPersonActive(true);

                animator = Self.anim;
            }
            catch (MissingReferenceException)
            {
                MonoBehaviour.Destroy(Self.gameObject);
            }
        }
Exemplo n.º 4
0
        public IdleMovement(CitizenBehaviour self, float time)
        {
            Self            = self;
            ActionCompleted = false;

            ObjectiveRange = 0.15f;

            actionTimer      = time;
            newDirectionTime = Random.Range(5f, 15f);
            Self.SetPersonActive(true);

            animator = Self.anim;


            ExecuteAction();
        }
Exemplo n.º 5
0
        public BuyFromStore(CitizenBehaviour self, Building_Normal_Service target)
        {
            Self                = self;
            ActionCompleted     = false;
            CurrentActionTarget = target.gameObject;
            ObjectiveRange      = 0.15f;

            timer = Random.Range(7.5f, 15f);

            Self.SetPersonActive(true);

            targetScript = target as Building_Normal_Service;

            animator = Self.anim;

            targetPosition = target.transform;

            ExecuteAction();
        }
Exemplo n.º 6
0
		public ExtortStoreAction(CitizenBehaviour self, Building target)
		{
			Self = self;
			ActionCompleted = false;
			try{
				try{
					CurrentActionTarget = target.gameObject;

				}
				catch(System.Exception) {
					MonoBehaviour.Destroy (self.gameObject);
				}

				Gunparticle = Self.transform.GetChild (0).GetChild(0). GetChild (1).GetComponent<ParticleSystem> ();

				animator = Self.anim;
				ObjectiveRange = 0.15f;
				Self.SetPersonActive (true);
                if (target.GetType() == typeof(Building_Normal_Service_Restaurant_ItalianRestaurant))
                {
                    //Debug.Log("Target is mafia restaurant");
                    GetNewTarget(WorldObjects.ValidTargets);

                    return;
                }


                CurrentActionTarget = target.gameObject;
				targetScript = target as Building_Normal_Service;
				targetPosition = target.transform;



            }
			catch(MissingReferenceException)
			{
				MonoBehaviour.Destroy (Self.gameObject);
			}
		}