Exemplo n.º 1
0
    public override string Apply()
    {
        MichaelCasey npc   = GetComponent <MichaelCasey>();
        FatherOwens  owens = GameObject.Find("Father Owens _ 1").GetComponent <FatherOwens> ();

        if (queryName == "checkIsBusy")
        {
            if (npc.getBusy())
            {
                return("true");
            }
            else
            {
                return("false");
            }
        }
        else if (queryName == "checkFirst")
        {
            if (owens.getFirstSermon())
            {
                return("true");
            }
            else
            {
                return("false");
            }
        }
        else if (queryName == "checkSecond")
        {
            if (owens.getSecondSermon())
            {
                return("true");
            }
            else if (!owens.getSecondSermon() && (PlayerPrefs.GetInt("TimePassed") > 1500))
            {
                return("listen");
            }
            else
            {
                return("false");
            }
        }
        else if (queryName == "checkBusyReset")
        {
            if (!owens.getSecondSermon() && (PlayerPrefs.GetInt("TimePassed") > 1500))
            {
                return("true");
            }
            else
            {
                return("false");
            }
        }
        return("true");
    }
Exemplo n.º 2
0
 // NOTE: DO NOT EXCESS MakeSad in the delegate or else you will get
 // a null reference exception
 public Action_Owens() : base(delegate(){
     FatherOwens n = GetComponent <FatherOwens>();
     if (actionName2 == "markFirstSermon")
     {
         n.setFirstSermon(true);
     }
     else if (actionName2 == "markSecondSermon")
     {
         n.setSecondSermon(true);
     }
     else if (actionName2 == "makeBusy")
     {
         n.setBusy(true);
         //For debugging
         //PlayerPrefs.SetInt("TimePassed",1600);
     }
     else if (actionName2 == "makeNotBusy")
     {
         n.setBusy(false);
     }
     else if (actionName2 == "addRep")
     {
         n.setReputation(5);
         PlayerPrefs.SetInt("Owens_Rep", 1);
     }
     else if (actionName2 == "subRep")
     {
         n.setReputation(-5);
         PlayerPrefs.SetInt("Owens_Rep", -1);
     }
     else if (actionName2 == "hideNPC2")
     {
         // hide Michael and Father
         GameObject.Find("Michael Casey _ 2").GetComponent <SpriteRenderer>().enabled = false;
         GameObject.Find("Father Owens _ 2").GetComponent <SpriteRenderer>().enabled  = false;
         GameObject.Find("Mayor _ 2").GetComponent <Mayor>().setEnd(true);
         PlayerPrefs.SetString("outcome", "peaceful");
     }
     else if (actionName2 == "hideNPC3")
     {
         // hide Michael, Father, and Mayor
         GameObject.Find("Michael Casey _ 2").GetComponent <SpriteRenderer>().enabled = false;
         GameObject.Find("Father Owens _ 2").GetComponent <SpriteRenderer>().enabled  = false;
         GameObject.Find("Mayor _ 2").GetComponent <SpriteRenderer>().enabled         = false;
         PlayerPrefs.SetString("outcome", "bloodbath");
     }
     else if (actionName2 == "death")
     {
         //End the game
         //GameObject.Find ("Gunshot").gameObject.transform.GetChild(0).gameObject.SetActive(true);
         //GameObject.Find ("Gunshot").GetComponent<AudioSource>().Play();
         Application.LoadLevel(6);
     }
 }) {}
Exemplo n.º 3
0
    public override string Apply()
    {
        FatherOwens npc = GetComponent <FatherOwens>();

        if (npc.getBusy())
        {
            return("true");
        }
        else
        {
            return("false");
        }
    }
Exemplo n.º 4
0
    // NOTE: DO NOT EXCESS MakeSad in the delegate or else you will get
    // a null reference exception
    public markProgress_Owens() : base(delegate(){
        print("I'm trying to do something");

        FatherOwens n = GameObject.Find("Father Owens").GetComponent <FatherOwens>();
        if (toChange == "firstSermon")
        {
            print("I'm doing the right thing.");

            n.setFirstSermon(true);
        }
        else if (toChange == "secondSermon")
        {
            n.setSecondSermon(true);
        }
        else if (toChange == "firstConvo")
        {
            //n.setFirstConvo = true;
        }
    }) {}
Exemplo n.º 5
0
    public override string Apply()
    {
        FatherOwens npc = GameObject.Find("Father Owens").GetComponent <FatherOwens>();

        if (toCheck == "first sermon")
        {
            if (npc.getFirstSermon())
            {
                return("true");
            }
            return("false");
        }
        else if (toCheck == "second sermon")
        {
            if (npc.getSecondSermon())
            {
                return("true");
            }
            return("false");
        }
        return("false");
    }
Exemplo n.º 6
0
 // NOTE: DO NOT EXCESS MakeSad in the delegate or else you will get
 // a null reference exception
 public changeReputation() : base(delegate(){
     FatherOwens n = GameObject.Find("Father Owens").GetComponent <FatherOwens>();
     n.setReputation(n.getReputation() + reputation);
 }) {}
Exemplo n.º 7
0
    public override string Apply()
    {
        FatherOwens npc = GetComponent <FatherOwens>();

        if (query == "checkIsBusy")
        {
            if (npc.getBusy())
            {
                return("true");
            }
            else
            {
                return("false");
            }
        }
        else if (query == "checkFirst")
        {
            if (npc.getFirstSermon())
            {
                return("true");
            }
            else
            {
                return("false");
            }
        }
        else if (query == "checkSecond")
        {
            if (!npc.getSecondSermon() && (PlayerPrefs.GetInt("TimePassed") > 1029))
            {
                return("false");
            }
            else
            {
                return("true");
            }
        }
        else if (query == "checkBusyReset1")
        {
            if (!npc.getSecondSermon() && (PlayerPrefs.GetInt("TimePassed") > 1029))
            {
                return("true");
            }
            else
            {
                return("false");
            }
        }
        else if (query == "checkKnowledge")
        {
            if (PlayerPrefs.HasKey("Robby"))
            {
                print("has key");
                if (PlayerPrefs.GetString("Robby") == "true")
                {
                    return("true");
                }
                else
                {
                    return("false");
                }
            }
            else
            {
                return("false");
            }
        }
        else if (query == "checkOutcome")
        {
            return(PlayerPrefs.GetString("outcome"));
        }
        else if (query == "checkStanding")
        {
            if (PlayerPrefs.GetInt("Owens_Rep") > 0)
            {
                return("good");
            }
            else
            {
                return("bad");
            }
        }
        return("true");
    }
Exemplo n.º 8
0
 // NOTE: DO NOT EXCESS MakeSad in the delegate or else you will get
 // a null reference exception
 public makeBusy() : base(delegate(){
     FatherOwens n = GameObject.Find("Father Owens").GetComponent <FatherOwens>();
     n.setBusy(busy);
 }) {}