Ejemplo n.º 1
0
 void OnFanReachedEnd()
 {
     lastUsedPit.Fan(0);
     waitingForFanReachedEnd = false;
     lastUsedPit             = null;
     isFanning = false;
 }
Ejemplo n.º 2
0
        public override void AddComponents()          /// In this section you can define any item and have it place in the camp x,y,z location.
        {
            ChestLevel1 chest    = new ChestLevel1(); ////Chest level 1-6 This is gonna decide what it looks like.
            FirePit     firepit  = new FirePit();     //// Camps firepit.
            Campfire    campfire = new Campfire();    //// The fire in the pit.

            firepit.ItemID  = 0xFAC;
            campfire.ItemID = 0xDE3;

            TreasureMapChest.Fill(chest, 1);      //// Chest level 1-6 This decides what kinda loot inside.

            AddItem(chest, 4, 4, 0);              //// Adding items to the ground around the spawner. (x,y,z)
            AddItem(firepit, 0, 0, 0);
            AddItem(campfire, 0, 0, 1);

            AddMobile(new Orc(), 15, 2, -2, 0);              /// Adding mobs to the area around the spawner.  (WanderRange,x,y,z)
            AddMobile(new Orc(), 15, -2, -2, 0);
            AddMobile(new OrcCaptain(), 15, 2, 2, 0);
            AddMobile(new OrcishLord(), 15, -2, 2, 0);

            switch (Utility.Random(2))                ////  This is used for adding random mobs to the camp.
            {
            case 0: m_mob = new Ogre(); break;

            case 1: m_mob = new Ettin(); break;
            }

            AddMobile(m_mob, 15, -2, 0, 0);               /// This decides where to place the random mob. (WanderRange,x,y,z)
        }
Ejemplo n.º 3
0
 void OnIgniteDone()
 {
     GetComponent <Animation>().CrossFade(pokingToIdle.name);
     firePit.Ignited();
     isIgniting              = false;
     firePit                 = null;
     goingBackToIdle         = true;
     goingBackToIdleDoneTime = Time.time + GetComponent <Animation>()[pokingToIdle.name].length;
 }
Ejemplo n.º 4
0
 void OnFirePitFullFlame()
 {
     Debug.Log("Effect: full flame! YESS!!!");
     firePitDoneDialog.TriggerSound();
     GetComponent <Animation>().CrossFade(firePitDone.name);
     waitingForFanReachedEnd = false;
     lastUsedPit             = null;
     waitingForPitDone       = true;
     waitingForPitDoneTime   = Time.time + firePitDone.length;
 }
Ejemplo n.º 5
0
    private void OnTriggerEnter(Collider other)
    {
        FirePit firePit = other.GetComponent <FirePit>();

        if (firePit && CanHitEnemy())
        {
            onFirePosition = true;
            _animator.SetBool("Firing", true);
        }
    }
Ejemplo n.º 6
0
	//public GameObject fire;

	// Use this for initialization
	void Start () {
		Flip ();
		pointA = transform.position.x;
		pointB = transform.position.x - 80;
		anim = GetComponent<Animator>();
		rope = this.transform.GetChild(0).gameObject;
		Fire = FindObjectOfType<FirePit> ();
		win = FindObjectOfType<Win> ();
		//fire =  FirePit.Fire;

	}
Ejemplo n.º 7
0
 void OnFirePitIgnite(FirePit pit)
 {
     BroadcastMessage("OnFirePitIgnitionStart");
     if (dontMoveModifier == null)
     {
         dontMoveModifier = new AllowedToMoveModifier("igniting");
         avatar.AddAllowedToMoveModifier(dontMoveModifier);
     }
     GetComponent <Animation>().CrossFade(ignite.name);
     GetComponent <Animation>().PlayQueued(poking.name);
     ignitionEndTime = Time.time + ignitionTime;
     isIgniting      = true;
     firePit         = pit;
     pit.StartIgniting();
 }
Ejemplo n.º 8
0
    void OnFanRequested(FirePit pit)
    {
        if (!isInFanMode)
        {
            if (!IsWaitingForFan())
            {
                StartFanMode();
            }
            return;
        }

        float fanTime  = Mathf.Clamp(fanAnimationState.normalizedTime, 0, 1.0f);
        int   fanPower = 0;

        if (isFanning)
        {
            if (fanTime < lessThanFailThreshold)
            {
                return;
            }
//			else if (fanTime >= moreThanFailThreshold)
//			{
//				isFanning = false;
//			}
            else
            {
                if (fanTime > moreThanPerfectThreshold)
                {
                    fanPower = perfectFanAmount;
                }
                else
                {
                    fanPower = mediumFanAmount;
                } fanDirectionIsUp = !fanDirectionIsUp;
            }
        }

        if (!isFanning)
        {
            if (fanTime == 1.0f)
            {
                fanDirectionIsUp = !fanDirectionIsUp;
                isFanning        = true;
            }
            else
            {
                return;
            }
        }

        if (fanDirectionIsUp)
        {
            StartAnimationAt(fanUp, birchUp, 1.0f - fanTime);
        }
        else
        {
            StartAnimationAt(fanDown, birchDown, 1.0f - fanTime);
        } waitingForFanReachedEnd = true;
        lastUsedPit = pit;
        if (fanPower != 0)
        {
            pit.Fan(fanPower);
        }
    }
Ejemplo n.º 9
0
 public virtual void FanFirePit(FirePit pit)
 {
 }
Ejemplo n.º 10
0
 public virtual void IgniteFirePit(FirePit pit)
 {
 }
Ejemplo n.º 11
0
 public override void FanFirePit(FirePit pit)
 {
     transform.parent.BroadcastMessage("OnFanRequested", pit);
 }
Ejemplo n.º 12
0
 public override void IgniteFirePit(FirePit pit)
 {
     transform.parent.BroadcastMessage("OnFirePitIgnite", pit);
 }