Exemple #1
0
    public override void OnApply(ActorData actor, ActorData source)
    {
        if (learnAllAbilities)
        {
            foreach (Talent skill in Globals.campaign.GetJobsData().JobDB.GetCopy(newJob).GetTotalTalentPool())
            {
                actor.LearnTalent(newJob, skill);
            }
        }


        switch (switchPrimary)
        {
        case JobCategory.Primary:
        {
            prevJobs = actor.primaryJob;

            actor.ChangeJobs(newJob, JobCategory.Primary);
            break;
        }

        case JobCategory.Secondary:
        {
            prevJobs = actor.secondaryJob;
            actor.ChangeJobs(newJob, JobCategory.Secondary);
            break;
        }

        case JobCategory.Race:
        {
            prevJobs = actor.race;
            actor.ChangeSpecies(newJob);

            break;
        }
        }
    }
    void PrimaryJobChanged(ActorData data)
    {
        int v = primaryJob.value;

        List <Job> jobs = Globals.campaign.GetJobsData().GetJobsAvaliableData(data);


        foreach (Job job in jobs)
        {
            if (job.Name == primaryJob.options[v].text)
            {
                data.ChangeJobs(job.GetKey(), SwitchJobsEffect.JobCategory.Primary);
                Debug.Log("Job changed");
            }
        }

        UpdateJobs(data);
    }
    void SecondaryJobChanged(ActorData data)
    {
        int v = secondaryJob.value;

        List <Job> jobs = Globals.campaign.GetJobsData().GetJobsAvaliableData(data);

        if (v == 0)
        {
            //no job selected
            data.secondaryJob = "";
            return;
        }

        foreach (Job job in jobs)
        {
            if (job.Name == secondaryJob.options[v].text)
            {
                data.ChangeJobs(job.GetKey(), SwitchJobsEffect.JobCategory.Secondary);
                Debug.Log("Job changed");
            }
        }

        UpdateJobs(data);
    }
Exemple #4
0
    public void SwapPrimaryJob()
    {
        currActor.ChangeJobs(currentJob.GetKey(), SwitchJobsEffect.JobCategory.Primary);

        PrintCurrentJobs();
    }