Exemplo n.º 1
0
    /* void Update()
     * {
     *   CP = canvas.GetComponent<CreaturePicker>();
     *
     *   if (!CP)
     *   {
     *       Debug.Log("didnt get script");
     *       return;
     *   }
     *   index = CP.GetIndex();
     *
     *   HUD = GameObject.Find("HUDCanvas").GetComponent<Canvas>();
     *
     *   if (HUD.enabled)
     *   {
     *       GetPawn();
     *   }
     * }*/

    //private void GetPawn()
    void Update()
    {
        if (DelayOn == true)
        {
            DelayCounter++;
            if (DelayCounter >= DelayMax)
            {
                DelayCounter = 0;
                DelayOn      = false;
            }
        }

        Selection1 = GameObject.Find("selection1").GetComponent <Canvas>();
        Selection2 = GameObject.Find("selection2").GetComponent <Canvas>();

        if (Selection1.enabled == false && Selection2.enabled == false)
        {
            PWPlayerController PWC = (PWPlayerController)controller;
            //CameraController CC = (CameraController)Pawn;

            if (!PWC)
            {
                return;
            }
            SC.Switch(); //changes cameras
            // CC.StartG();
            PWC.ChangeSpawnPrefab();
            controller.RequestSpawn();
            //PWC.CamOn();//calls Camera controller to make the cameras look at players
        }
    }
Exemplo n.º 2
0
    public virtual void Start()
    {
        IsSpectator = false;

        // Add and Set up Rigid Body
        rb             = gameObject.AddComponent <Rigidbody>();
        rb.constraints = RigidbodyConstraints.FreezeRotation;

        Health = StartingHealth;
        //Life = StartingLife;

        // SA = gameObject.AddComponent<StompAttack>();
        PWC  = (PWPlayerController)controller;
        Life = PWC.Live();
    }
Exemplo n.º 3
0
    protected override bool ProcessDamage(Actor Source, float Value, DamageEventInfo EventInfo, Controller Instigator)
    {
        // Setup for Logging Dammage Information
        string DamageEventString = Source.ActorName + " " + EventInfo.DamageType.verb + " " + this.ActorName + " (" + Value.ToString() + " damage)";

        if (Instigator)
        {
            DamageEventString = Instigator.Name + " via " + DamageEventString;
        }
        else
        {
            DamageEventString = "The World via " + DamageEventString;
        }
        DAMAGELOG(DamageEventString);

        //Applying damage to health


        Health -= Value;

        if (Health <= 0f)
        {
            if (Instigator)
            {
                PWPlayerController PWPC     = ((PWPlayerController)Instigator);
                PWPlayerController PWPCthis = ((PWPlayerController)controller);
                LOG(PWPC.PlayerName + " Killed " + PWPCthis.PlayerName);
            }
            else
            {
                PWPlayerController PWPCthis = ((PWPlayerController)controller);
                LOG("World Killed " + PWPCthis.PlayerName);
            }

            IgnoresDamage = true;

            Game.Self.GetSpectator(controller);
        }



        return(true);
    }