Example #1
0
    public void Recruit(Recruitable person)
    {
        if (_carried != null)
        {
            return;
        }
        _anim.SetBool("IsCarrying", true);
        person.Available = false;
        WanderAI wander = person.GetComponent <WanderAI>();

        if (wander != null)
        {
            wander.enabled = false;
        }
        person.DisableMovement();
        person.CancelInvoke();
        person.transform.parent           = transform;
        person.transform.localPosition    = Vector2.up;
        person.transform.localEulerAngles = new Vector3(0, 0, 90);
        person.SortOrderOffset            = 2;
        foreach (Collider2D c in person.transform.GetComponents <Collider2D>())
        {
            c.enabled = false;
        }
        person.GetRigidbody().Sleep();
        _carried = person;
        SoundPlayer.Instance.PlaySound(LiftSFX);
    }
Example #2
0
 // Use this for initialization
 void Awake()
 {
     _controllable = GetComponent <Recruitable>();
     if (_controllable == null)
     {
         enabled = false;
     }
     _controllable.MoveSpeed = 0.5f;
 }
Example #3
0
    void Spawn()
    {
        Vector2 pos = SpawnArea.GetRandomArea().GetRandomPoint();

        Recruitable person = Instantiate(Recruitables[Random.Range(0, Recruitables.Length)]);

        person.Attributes.Social     = Random.Range(0, 256);
        person.Attributes.Leadership = Random.Range(0, 256);
        person.transform.position    = pos;

        Invoke("Spawn", Interval);
    }
Example #4
0
    public void PutDownCarried(Team dest)
    {
        if (_carried != null)
        {
            if (dest.AddPerson(_carried))
            {
                try
                {
                    Recruitable person     = _carried as Recruitable;
                    int         voiceIndex = UnityEngine.Random.Range(0, person.VoiceLines.Length);
                    SoundPlayer.Instance.PlaySound(person.VoiceLines[voiceIndex]);
                } catch (Exception e) {}

                _carried = null;
                _anim.SetBool("IsCarrying", false);
            }
        }
    }
Example #5
0
    Stats GetTotalStats()
    {
        Stats s = new Stats();

        foreach (TeamSlot ts in DevTeam.TeamSlots)
        {
            Recruitable person = ts.Person as Recruitable;
            if (person != null)
            {
                Stats pStats = person.Attributes;
                s.Programming   += pStats.Programming;
                s.GraphicDesign += pStats.GraphicDesign;
                s.GameDesign    += pStats.GameDesign;
                s.SoundDesign   += pStats.SoundDesign;
                s.Social        += pStats.Social;
                s.Leadership    += pStats.Leadership;
            }
        }

        return(s);
    }
        public bool Equals(DestinyMilestoneDefinition input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     DisplayProperties == input.DisplayProperties ||
                     (DisplayProperties != null && DisplayProperties.Equals(input.DisplayProperties))
                     ) &&
                 (
                     DisplayPreference == input.DisplayPreference ||
                     (DisplayPreference != null && DisplayPreference.Equals(input.DisplayPreference))
                 ) &&
                 (
                     Image == input.Image ||
                     (Image != null && Image.Equals(input.Image))
                 ) &&
                 (
                     MilestoneType == input.MilestoneType ||
                     (MilestoneType != null && MilestoneType.Equals(input.MilestoneType))
                 ) &&
                 (
                     Recruitable == input.Recruitable ||
                     (Recruitable != null && Recruitable.Equals(input.Recruitable))
                 ) &&
                 (
                     FriendlyName == input.FriendlyName ||
                     (FriendlyName != null && FriendlyName.Equals(input.FriendlyName))
                 ) &&
                 (
                     ShowInExplorer == input.ShowInExplorer ||
                     (ShowInExplorer != null && ShowInExplorer.Equals(input.ShowInExplorer))
                 ) &&
                 (
                     ShowInMilestones == input.ShowInMilestones ||
                     (ShowInMilestones != null && ShowInMilestones.Equals(input.ShowInMilestones))
                 ) &&
                 (
                     ExplorePrioritizesActivityImage == input.ExplorePrioritizesActivityImage ||
                     (ExplorePrioritizesActivityImage != null && ExplorePrioritizesActivityImage.Equals(input.ExplorePrioritizesActivityImage))
                 ) &&
                 (
                     HasPredictableDates == input.HasPredictableDates ||
                     (HasPredictableDates != null && HasPredictableDates.Equals(input.HasPredictableDates))
                 ) &&
                 (
                     Quests == input.Quests ||
                     (Quests != null && Quests.SequenceEqual(input.Quests))
                 ) &&
                 (
                     Rewards == input.Rewards ||
                     (Rewards != null && Rewards.SequenceEqual(input.Rewards))
                 ) &&
                 (
                     VendorsDisplayTitle == input.VendorsDisplayTitle ||
                     (VendorsDisplayTitle != null && VendorsDisplayTitle.Equals(input.VendorsDisplayTitle))
                 ) &&
                 (
                     Vendors == input.Vendors ||
                     (Vendors != null && Vendors.SequenceEqual(input.Vendors))
                 ) &&
                 (
                     Values == input.Values ||
                     (Values != null && Values.SequenceEqual(input.Values))
                 ) &&
                 (
                     IsInGameMilestone == input.IsInGameMilestone ||
                     (IsInGameMilestone != null && IsInGameMilestone.Equals(input.IsInGameMilestone))
                 ) &&
                 (
                     Activities == input.Activities ||
                     (Activities != null && Activities.SequenceEqual(input.Activities))
                 ) &&
                 (
                     DefaultOrder == input.DefaultOrder ||
                     (DefaultOrder.Equals(input.DefaultOrder))
                 ) &&
                 (
                     Hash == input.Hash ||
                     (Hash.Equals(input.Hash))
                 ) &&
                 (
                     Index == input.Index ||
                     (Index.Equals(input.Index))
                 ) &&
                 (
                     Redacted == input.Redacted ||
                     (Redacted != null && Redacted.Equals(input.Redacted))
                 ));
        }