/// <summary>
 /// Applies the properties of the Mobility tactical package to this trait set.
 /// </summary>
 public static void ApplyMobilityUpgrade(this PlayerTraits traits)
 {
     Contract.Requires <ArgumentNullException>(traits != null);
     traits.Equipment.SprintStaminaDepletionRate = 0f;
     traits.Equipment.SprintStaminaRestoreDelay  = 0.66f;
     traits.Equipment.SprintStaminaRestoreRate   = 1.35f;
 }
 void Awake()
 {
     playerTraits          = GetComponent <PlayerTraits>();
     playerMove            = GetComponent <PlayerMovement>();
     bizarro               = GameObject.FindGameObjectWithTag("Bizarro");
     cameraShake           = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CameraShake>();
     gameManager           = GameObject.FindGameObjectWithTag("GM").GetComponent <GameManager>();
     teleportEffect        = (GameObject)Resources.Load("Effects/KillEffects/Teleport");
     cometEffect           = (GameObject)Resources.Load("Effects/Special/Comet");
     explosion             = (GameObject)Resources.Load("Effects/Special/Explosion");
     quakeEffect           = (GameObject)Resources.Load("Effects/Special/Quake");
     bloodEffect           = (GameObject)Resources.Load("Effects/Special/MobSplat");
     beatingEffect         = (GameObject)Resources.Load("Effects/Special/MobBeating");
     specialTimer          = gameObject.AddComponent <Timer>();
     bumpTimer             = gameObject.AddComponent <Timer>();
     bumpTimer.Trigger    += BumpOff;
     damage                = playerMove.damage;
     specialTimer.Trigger += SpecialClear;
     dashForce             = playerMove.dashForce * 2;
     dashTime              = playerMove.dashTime;
     bashForce             = playerMove.bashForce;
     bashTime              = playerMove.bashTime;
     dashTimer             = gameObject.AddComponent <Timer>();
     dashTimer.Trigger    += EndDash;
 }
    void Awake()
    {
        player       = GameObject.FindGameObjectWithTag("Player");
        playerTraits = player.GetComponent <PlayerTraits>();
        playerMove   = player.GetComponent <PlayerMovement>();
        bizarro      = GameObject.FindGameObjectWithTag("Bizarro");

        cameraShake    = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CameraShake>();
        gameManager    = GameObject.FindGameObjectWithTag("GM").GetComponent <GameManager>();
        teleportEffect = (GameObject)Resources.Load("Effects/KillEffects/Teleport");
        cometEffect    = (GameObject)Resources.Load("Effects/Special/Comet");
        explosion      = (GameObject)Resources.Load("Effects/Special/Explosion");
        quakeEffect    = (GameObject)Resources.Load("Effects/Special/Quake");
        dashEffect     = (GameObject)Resources.Load("Effects/Dash");
        bashEffect     = (GameObject)Resources.Load("Effects/Bash");

        beatingEffect         = (GameObject)Resources.Load("Effects/Special/MobBeating");
        specialTimer          = gameObject.AddComponent <Timer>();
        specialTimer.Trigger += SpecialClear;
        specialTimer.Go(3f);
        dashTimer          = gameObject.AddComponent <Timer>();
        dashTimer.Trigger += EndDash;
        bashTimer          = gameObject.AddComponent <Timer>();
        bashTimer.Trigger += EndDash;
        bashReset          = gameObject.AddComponent <Timer>();
        bashReset.Trigger += CanBash;
        dashReset          = gameObject.AddComponent <Timer>();
        dashReset.Trigger += CanDash;
    }
 /// <summary>
 /// Applies the properties of the A.A. Efficiency tactical package to this trait set.
 /// </summary>
 public static void ApplyAAEfficiencyUpgrade(this PlayerTraits traits)
 {
     Contract.Requires <ArgumentNullException>(traits != null);
     traits.Equipment.ArmorAbilityEnergyRechargeDelay = 1.0f;
     traits.Equipment.ArmorAbilityEnergyRechargeRate  = 2.0f;
     traits.Equipment.ArmorAbilityInitialEnergy       = 1.0f;
 }
 /// <summary>
 /// Applies the properties of the Wheelman tactical package to this trait set.
 /// </summary>
 public static void ApplyWheelmanUpgrade(this PlayerTraits traits)
 {
     Contract.Requires <ArgumentNullException>(traits != null);
     traits.Armor.VehicleShieldRechargeDelay = 1.50f;
     traits.Armor.VehicleShieldRechargeRate  = 1.50f;
     traits.Armor.VehicleEMPDisableDuration  = 0.50f;
 }
 void Awake()
 {
     gameManager   = GameObject.FindGameObjectWithTag("GM").GetComponent <GameManager>();
     player        = GameObject.FindGameObjectWithTag("Player");
     playerTraits  = player.GetComponent <PlayerTraits>();
     myDeathScript = GetComponent <Death>();
     GetComponent <Renderer>().sortingLayerID = 0;
 }
Esempio n. 7
0
 void Awake()
 {
     thisCamera                  = GetComponent <Camera>();
     player                      = GameObject.FindGameObjectWithTag("Player");
     playerTraits                = player.GetComponent <PlayerTraits>();
     playerMovementScript        = player.GetComponent <PlayerMovement>();
     healthDisplay               = transform.Find("HealthDisplay").GetComponent <TextMesh>();
     thisCamera.orthographicSize = 10;
 }
Esempio n. 8
0
 void Awake()
 {
     gameManager         = GameObject.FindGameObjectWithTag("GM").GetComponent <EatLevel>();
     player              = GameObject.FindGameObjectWithTag("Player");
     playerTraits        = player.GetComponent <PlayerTraits>();
     flashTimer          = gameObject.AddComponent <Timer>();
     flashTimer.Trigger += FlashBack;
     startScale          = transform.localScale;
     shrinkDistance      = Vector3.Distance(startScale, Vector3.zero);
 }
Esempio n. 9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RespawnSettings"/> class with default values.
 /// </summary>
 public RespawnSettings()
 {
     _betrayalPenalty      = 5;
     _dualRespawnTiming    = true;
     _respawnTime          = 3;
     _secondaryRespawnTime = 7;
     _suicdePenalty        = 5;
     _traits = new PlayerTraits();
     _respawnTraitDuration = 5;
 }
Esempio n. 10
0
 void Awake()
 {
     gameManager             = GameObject.FindGameObjectWithTag("GM").GetComponent <GameManager>();
     playerTraits            = GetComponent <PlayerTraits>();
     playerKill              = GetComponent <PlayerKill>();
     dashEffect              = (GameObject)Resources.Load("Effects/Dash");
     bashEffect              = (GameObject)Resources.Load("Effects/Bash");
     bumpTimer               = gameObject.AddComponent <Timer>();
     bumpTimer.Trigger      += BumpOff;
     afterglowTimer          = gameObject.AddComponent <Timer>();
     afterglowTimer.Trigger += AfterglowOff;
     dazeTimer               = gameObject.AddComponent <Timer>();
     dazeTimer.Trigger      += DazeOff;
 }
Esempio n. 11
0
    void OnTriggerEnter2D(Collider2D othercollider)
    {
        if (othercollider.tag == "Player")
        {
            playertraits = othercollider.gameObject.GetComponent<PlayerTraits>();

            if (playertraits.currentmatter < playertraits.matter_max || playertraits.currentenergy < playertraits.energy_max)
            {
                playertraits.currentmatter += matter;
                playertraits.currentenergy += energy;
                this.gameObject.Recycle();
            }
        }
        //Debug.Log("hit"+othercollider);
    }
Esempio n. 12
0
        public int CreateMegaloPlayerTraits(string codeName, int nameStringIndex, int descStringIndex)
        {
            if (PlayerTraits.Count == PlayerTraits.Capacity)
            {
                return(TypeExtensions.kNone);
            }

            var traits = NewMegaloPlayerTraits();

            traits.CodeName               = codeName;
            traits.NameStringIndex        = nameStringIndex;
            traits.DescriptionStringIndex = descStringIndex;

            PlayerTraits.Add(traits);
            return(PlayerTraits.Count - 1);
        }
Esempio n. 13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MapOverrides"/> class with default values.
 /// </summary>
 public MapOverrides()
 {
     _baseTraits     = new PlayerTraits();
     _powerups       = new PowerupSettings[PowerupCount];
     _powerups[0]    = PowerupSettings.CreateDamageBoost();
     _powerups[1]    = PowerupSettings.CreateSpeedBoost();
     _powerups[2]    = PowerupSettings.CreateOvershield();
     _powerups[3]    = new PowerupSettings();
     _turretsOnMap   = true;
     _powerupsOnMap  = true;
     _aaOnMap        = true;
     _shortcutsOnMap = true;
     _grenadesOnMap  = true;
     ArmorAbilitySet = ArmorAbilitySet.MapDefault;
     WeaponSet       = WeaponSet.MapDefault;
     VehicleSet      = VehicleSet.MapDefault;
 }
Esempio n. 14
0
    void Start()
    {
        player = GameObject.FindGameObjectWithTag("Player");
        playertraits = player.GetComponent<PlayerTraits>();
        currentfuselage = player.transform.Find("fuselage").GetChild(0).gameObject;
        //Debug.Log("curret fuselage is" + currentfuselage);
        floatdamage = (float)basedamage * playertraits.damage_multiplier + (float)playertraits.damage_bonus;
        finaldamage = (int)floatdamage;
        final_proj_speed = base_proj_speed * 1;//playertrait not set up
        finalrof = baserof * playertraits.rof_multiplier;
        shot_delay = 1 / finalrof;
        basedps = baserof * (float)basedamage;
        finaldps = finalrof * (float)finaldamage;

        proj_instance.initialdamage = finaldamage;
        proj_instance.speed = final_proj_speed;

        if (this.transform == player.transform.FindChild("weapons").GetChild(0))
        {
            shootbutton = "Fire1";
        }

        if (this.transform == player.transform.FindChild("weapons").GetChild(1))
        {
            shootbutton = "Fire2";
        }
        //Debug.Log("hardpoints initial" + hardpoints);
        hardpoints = currentfuselage.transform.FindChild("hardpoints").childCount;
        //Debug.Log("hardpoints final" + hardpoints);
        if (hardpoints > shot_origins.Length)
        {
            originmax = shot_origins.Length;
        }
        else
        {
            originmax = hardpoints;
        }

        for (int i = 0; i < originmax; i++)
        {
            shot_origins[i].transform.parent = currentfuselage.transform.FindChild("hardpoints").GetChild(i);
            shot_origins[i].transform.localPosition = Vector3.zero;
        }
    }
Esempio n. 15
0
 void Awake()
 {
     gameManager  = GameObject.FindGameObjectWithTag("GM").GetComponent <GameManager>();
     timerText    = GameObject.FindGameObjectWithTag("Time").GetComponent <TextMesh>();
     healthText   = GameObject.FindGameObjectWithTag("Health").GetComponent <TextMesh>();
     eatText      = GameObject.FindGameObjectWithTag("Eat");
     thisCamera   = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera>();
     fade         = GameObject.FindGameObjectWithTag("Fade").GetComponent <GUITexture>();
     playerTraits = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerTraits>();
     gameManager.SetLevel(1);
     eatTimer          = gameObject.AddComponent <Timer>();
     eatTimer.Trigger += EatDisappear;
     eatTimer.Go(eatDisappearTime);
     startTimer          = gameObject.AddComponent <Timer>();
     startTimer.Trigger += StartGame;
     startTimer.Go(1f);
     eatText.SetActive(false);
     fade.color = new Color(0, 0, 0, 0);
     PlayerPrefs.DeleteAll();
 }
    void Awake()
    {
        gameManager  = GameObject.FindGameObjectWithTag("GM").GetComponent <GameManager>();
        playerTraits = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerTraits>();
        timerText    = GameObject.FindGameObjectWithTag("Time").GetComponent <TextMesh>();
        healthText   = GameObject.FindGameObjectWithTag("Health").GetComponent <TextMesh>();
        killText     = GameObject.FindGameObjectWithTag("Eat");
        thisCamera   = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera>();
//        fade = GameObject.FindGameObjectWithTag("Fade").GetComponent<GUITexture>();
        gameManager.SetLevel(3);
        killText.SetActive(false);
        killTimer               = gameObject.AddComponent <Timer>();
        killTimer.Trigger      += LiveDisappear;
        levelEndTimer           = gameObject.AddComponent <Timer>();
        levelEndTimer.Trigger  += ZoomEnd;
        zoomStartTimer          = gameObject.AddComponent <Timer>();
        zoomStartTimer.Trigger += ZoomStart;
        zoomStartTimer.Go(1f);
//        fade.color = new Color(0, 0, 0, 1);
        thisCamera.orthographicSize = 0.001f;
    }
Esempio n. 17
0
    void Awake()
    {
        gameManager  = GameObject.FindGameObjectWithTag("GM").GetComponent <GameManager>();
        playerTraits = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerTraits>();
        timerText    = GameObject.FindGameObjectWithTag("Time").GetComponent <TextMesh>();
        healthText   = GameObject.FindGameObjectWithTag("Health").GetComponent <TextMesh>();
        winText      = GameObject.FindGameObjectWithTag("Eat");
        thisCamera   = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera>();
        eatText      = GameObject.FindGameObjectWithTag("ET").GetComponent <TextMesh>();
        liveText     = GameObject.FindGameObjectWithTag("LT").GetComponent <TextMesh>();
        killText     = GameObject.FindGameObjectWithTag("KT").GetComponent <TextMesh>();
        bizarro      = GameObject.FindGameObjectWithTag("Bizarro").GetComponent <Bizarro>();
        //       fade = GameObject.FindGameObjectWithTag("Fade").GetComponent<GUITexture>();
        timerText.text  = "";
        blackHoleEffect = (GameObject)Resources.Load("Effects/Special/BlackHole");
        gameManager.SetLevel(4);
        winText.SetActive(false);
        winTimer                = gameObject.AddComponent <Timer>();
        winTimer.Trigger       += WinDisappear;
        zoomStartTimer          = gameObject.AddComponent <Timer>();
        zoomStartTimer.Trigger += ZoomStart;

        zoomStartTimer.Go(1f);
        // startZooming = true;
        //DEBUGGING

        eatTextTimer           = gameObject.AddComponent <Timer>();
        eatTextTimer.Trigger  += GoLive;
        liveTextTimer          = gameObject.AddComponent <Timer>();
        liveTextTimer.Trigger += GoKill;
        killTextTimer          = gameObject.AddComponent <Timer>();
        killTextTimer.Trigger += GoWin;

//        fade.color = new Color(0, 0, 0, 1);
        thisCamera.orthographicSize = 0.001f;
    }
Esempio n. 18
0
    void Start() // Initiallizing camera, animator, rigidboy
    {
        camManager = CameraManager.singleton;
        camManager.Init(transform);
        SetupAnimator();
        rigid = GetComponent <Rigidbody>();

        traits = GetComponentInChildren <PlayerTraits>();

        hasMelee  = traits.Melee;
        hasRanged = traits.Ranged;

        hasBlock = traits.Block;

        hasDash = traits.Dash;
        if (hasDash)
        {
            dashing = GetComponentInChildren <DashingFeature>();
        }

        targeting = GetComponent <TargetingHandler>();

        health = GetComponentInChildren <PlayerHealth>();
    }
Esempio n. 19
0
 public GameState()
 {
     currentGS = new GameState();
     currentPT = new PlayerTraits();
     currentInventory = new Inventory();
 }
 void Awake()
 {
     eatenEffect  = (GameObject)Resources.Load("1Eat/FoodEaten");
     playerTraits = GetComponent <PlayerTraits>();
 }
Esempio n. 21
0
 /// <summary>
 /// Applies the properties of the Stealth support upgrade to this trait set.
 /// </summary>
 public static void ApplyStealthUpgrade(this PlayerTraits traits)
 {
     Contract.Requires <ArgumentNullException>(traits != null);
     traits.Movement.Stealth             = TraitFlag.Enabled;
     traits.Equipment.AssassinationSpeed = 1.20f;
 }
Esempio n. 22
0
 /// <summary>
 /// Applies the properties of the Gunner support upgrade to this trait set.
 /// </summary>
 public static void ApplyGunnerUpgrade(this PlayerTraits traits)
 {
     Contract.Requires <ArgumentNullException>(traits != null);
     traits.Equipment.TurretCooldownRate = 0.66f;
 }
Esempio n. 23
0
 void Awake()
 {
     playerTraits = GetComponent <PlayerTraits>();
 }
Esempio n. 24
0
 public TraitsViewModel(PlayerTraits traits)
 {
     _traits = traits;
 }
Esempio n. 25
0
 /// <summary>
 /// Applies the properties of the Drop Recon support upgrade to this trait set.
 /// </summary>
 public static void ApplyDropReconUpgrade(this PlayerTraits traits)
 {
     Contract.Requires <ArgumentNullException>(traits != null);
     traits.Equipment.OrdnanceWarningDistance = 1.2f;
     traits.Equipment.OrdnanceWarningDuration = 5f;
 }
 void Awake()
 {
     playerTraits = GetComponent <PlayerTraits>();
     attackDamage = playerTraits.AttackDamage;
 }
Esempio n. 27
0
 /// <summary>
 /// Applies the properties of the Nemesis support upgrade to this trait set.
 /// </summary>
 public static void ApplyNemesisUpgrade(this PlayerTraits traits)
 {
     Contract.Requires <ArgumentNullException>(traits != null);
     traits.ScreenAndAudio.Nemesis         = TraitFlag.Enabled;
     traits.ScreenAndAudio.NemesisDuration = 4.5f;
 }
Esempio n. 28
0
 /// <summary>
 /// Applies the properties of the Ammo support upgrade to this trait set.
 /// </summary>
 public static void ApplyAmmoUpgrade(this PlayerTraits traits)
 {
     Contract.Requires <ArgumentNullException>(traits != null);
     traits.Equipment.ExtraAmmo = TraitFlag.Enabled;
 }
Esempio n. 29
0
        /// <summary>
        /// Applies the properties of the Resupply tactical package to this trait set.
        /// </summary>

        public static void ApplyResupplyUpgrade(this PlayerTraits traits)
        {
            Contract.Requires <ArgumentNullException>(traits != null);
            traits.Equipment.GrenadePickup = TraitFlag.Enabled;
        }
Esempio n. 30
0
        void IMegaloVariant.Create(GameVariant gt, MegaloData megalo)
        {
            gt.HasWeaponTuning = false;

            #region Base Variant

            // Metadata
            var metadata = new ContentMetadata
            {
                Name        = "Race v2.0",
                Description = "Gentlemen, start your engines.",
                CreatedBy   = new ContentAuthor("synth92"),
                ModifiedBy  = new ContentAuthor("synth92"),
                VariantIcon = VariantIcon.Race,
            };
            gt.Metadata = metadata;


            // General Settings
            var generalSettings = new GeneralSettings
            {
                PointsSystemEnabled = false,
                NumberOfRounds      = 1,
                TeamsEnabled        = false,
            };
            gt.GeneralSettings = generalSettings;


            // Respawn Settings
            var respawnSettings = new RespawnSettings
            {
                BetrayalPenalty        = 0,
                SuicidePenalty         = 0,
                InitialRespawnDuration = 3,
                MinimumRespawnDuration = 3,
            };
            gt.RespawnSettings = respawnSettings;


            // Social Settings
            var socialSettings = new SocialSettings
            {
                BetrayalBooting     = false,
                FriendlyFireEnabled = false,
                OpenChannelVoice    = true,
                DeadPlayerVoice     = true,
                EnemyVoice          = true,
            };
            gt.SocialSettings = socialSettings;


            // Map Overrides
            var mapOverrides = new MapOverrides
            {
                ArmorAbilitiesOnMap    = false,
                GrenadesOnMap          = false,
                IndestructibleVehicles = true,
                VehicleSet             = VehicleSet.DeleteAllExceptMongoose,
                WeaponSet = WeaponSet.NoWeapons,
            };
            gt.MapOverrides = mapOverrides;


            #region Base Player Traits

            var baseTraits = new PlayerTraits();
            gt.MapOverrides.BasePlayerTraits = baseTraits;

            // Base Player Traits -> Appearance
            baseTraits.Appearance.DeathEffect        = ArmorEffect.GruntBirthdayParty;
            baseTraits.Appearance.GamertagVisibility = HudVisibility.VisibleToEveryone;
            baseTraits.Appearance.WaypointVisibility = HudVisibility.VisibleToEveryone;

            // Base Player Traits -> Armor
            baseTraits.Armor.AssassinationImmunity = TraitFlag.Enabled;
            baseTraits.Armor.Invincibility         = TraitFlag.Enabled;

            // Base Player Traits -> Appearance
            baseTraits.Equipment.InitialPrimaryWeapon   = Weapon.SpartanLaser;
            baseTraits.Equipment.InitialSecondaryWeapon = Weapon.NoWeapon;
            baseTraits.Equipment.TacticalPackage        = ArmorMod.NoTacticalPackage;
            baseTraits.Equipment.SupportUpgrade         = ArmorMod.NoSupportUpgrade;

            // Base Player Traits -> Movement
            baseTraits.Movement.Sprint       = TraitFlag.Disabled;
            baseTraits.Movement.VehicleUsage = VehicleUsageMode.DriverOnly;

            // Base Player Traits -> Screen & Audio
            baseTraits.ScreenAndAudio.MotionSensor = MotionSensorMode.Enhanced;
            baseTraits.ScreenAndAudio.ShieldHud    = TraitFlag.Disabled;

            #endregion


            // Loadouts
            var loadouts = new LoadoutSettings
            {
                PersonalLoadoutsEnabled = false,
                MapLoadoutsEnabled      = false,
            };
            gt.LoadoutSettings = loadouts;


            // Teams
            var teams = new TeamSettings();
            gt.TeamSettings = teams;
            teams[0].Name.Set("Racers");
            teams[1].Name.Set("Observers");


            // Ordnance
            var ordnanceSettings = new OrdnanceSettings
            {
                InitialOrdnanceEnabled  = false,
                RandomOrdnanceEnabled   = false,
                PersonalOrdnanceEnabled = false,
            };
            gt.OrdnanceSettings = ordnanceSettings;


            #endregion
        }
Esempio n. 31
0
 public UserDefinedTraits()
 {
     _traits = new PlayerTraits();
 }
Esempio n. 32
0
 /// <summary>
 /// Applies the properties of the Dexterity support upgrade to this trait set.
 /// </summary>
 public static void ApplyDexterityUpgrade(this PlayerTraits traits)
 {
     Contract.Requires <ArgumentNullException>(traits != null);
     traits.Equipment.WeaponSwitchSpeed = 1.15f;
     traits.Equipment.WeaponReloadSpeed = 1.66f;
 }
Esempio n. 33
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PowerupSettings"/> class with default values.
 /// </summary>
 public PowerupSettings()
 {
     _primary   = new PlayerTraits();
     _secondary = new PlayerTraits();
 }
Esempio n. 34
0
 //This script holds the affixes for magic items.
 //Available affixes is dependent on ilvl.
 // Use this for initialization
 void Start()
 {
     player = GameObject.FindGameObjectWithTag("Player");
     traits = player.GetComponent<PlayerTraits>();
     name = gameObject.name;
 }