Esempio n. 1
0
        public static Power GetPower(PowerName powerName)
        {
            switch (powerName)
            {
            case PowerName.StrongBody:
                return(new Power(powerName, "Strong Body", "You deal +100% damage in melee and you take half damage from all sources."));

            case PowerName.LayOnHands:
                return(new Power(powerName, "Lay on Hands", "Lay hands on an injured person near you to heal them. Laying on hands is faster than stabilization and causes the injured to recover consciousness."));

            case PowerName.SecondWind:
                return(new Power(powerName, "Second Wind", "Once per emergency, catch second wind and immediately heal of all injuries. Use this ability by right-clicking yourself."));

            case PowerName.Flight:
                return(new Power(powerName, "Flight", "You levitate above ground, moving at double speed. You can also move across water and ignore difficult terrain."));

            case PowerName.FavoredEnemySupernatural:
                return(new Power(powerName, "Favored Enemy: Supernatural", "You deal an extra +100% damage to supernatural enemies in any combat."));

            case PowerName.CastWater:
                return(new Power(powerName, "Cast Water", "A ray of water springs from your hands and douses a distant flame or hurts an enemy."));

            case PowerName.WaterAffinity:
                return(new Power(powerName, "Water Affinity", "You create triple as much water while adjacent to a well or a body of water."));

            case PowerName.SummonWaterElemental:
                return(new Power(powerName, "Summon Water Elemental", "Once per emergency, summon a water elemental that tries to extinguish nearby flames. Cast this spell by right-clicking yourself. The elemental disperses after some time."));

            default:
                return(new Power(powerName, powerName.ToString(), "This is a not-yet-implemented power and has no effect."));
            }
        }
Esempio n. 2
0
        public static void DrawPower(PowerName powerName, Rectangle rectangle)
        {
            Primitives.DrawAndFillRectangle(rectangle, Color.LightBlue, Color.DarkBlue, 1);
            Power power = PowerDb.GetPower(powerName);

            Writer.DrawString("{b}" + power.Name + "{/b}\n" + power.Description, rectangle.Extend(-5, -5), Color.Black, degrading: true);
        }
Esempio n. 3
0
        public void BeginInteract(World world, PowerName power, Actor target,
                                  InteractSuccessCallback success, AIEventCallback callback)
        {
            Interaction interaction = new Interaction(power, target, success, callback);

            // If this interaction is blacklisted or in progress, return immediately
            if (blacklistedInteractions.Contains(interaction))
            {
                callback("blacklist");
                return;
            }
            if (curInteraction != null)
            {
                // TODO: Should we allow actions to queue up instead?
                callback("busy");
                return;
            }

            // Register this interaction as in-progress and run it
            curInteraction = interaction;
            world.Me.UsePower(power, target);

            // FIXME: We need an OnWorldUpdate event that will the in-progress interaction
            // and determine if it has completed, timed out, or is still in progress
        }
            public PowerInfo(ExportEntry export, bool isCorrectedPackage)
            {
                PowerName = export.ObjectName;
                if (!MapPowerType(export) && !IsWhitelistedPower(export))
                {
                    // Whitelisted powers bypass this check
                    // Powers that do not list a capability type are subclasses. We will not support using these
                    IsUsable = false;
                    return;
                }
                if (!IsWhitelistedPower(PowerName) &&
                    // Forced blacklist after whitelist
                    (
                        PowerName.Contains("Ammo") ||
                        PowerName.Contains("Base") ||
                        PowerName.Contains("FirstAid") ||
                        PowerName.Contains("Player") ||
                        PowerName.Contains("GunshipRocket") ||
                        (PowerName.Contains("NPC") && PowerName != "SFXPower_CombatDrone_NPC") || // this technically should be used, but too lazy to write algo to figure it out
                        PowerName.Contains("Player") ||
                        PowerName.Contains("Zaeed") || // Only use player version. The normal one doesn't throw the grenade
                        PowerName.Contains("HuskTesla") ||
                        PowerName.Contains("Kasumi") || // Depends on her AI
                        PowerName.Contains("CombatDroneDeath") || // Crashes the game
                        PowerName.Contains("DeathChoir") || // Buggy on non-praetorian, maybe crashes game?
                        PowerName.Contains("Varren") || // Don't use this
                        PowerName.Contains("Lift_TwrMwA") || // Not sure what this does, but culling itCrashes the game, maybe
                        PowerName.Contains("Crush") || // Don't let enemies use this, it won't do anything useful for the most part
                        PowerName == "SFXPower_MechDog" || // dunno what this is
                        PowerName == "SFXPower_CombatDroneAttack" || // Combat drone only
                        PowerName == "SFXPower_HeavyMechExplosion" || // This is not actually used and doesn't seem to work but is on some pawns
                        PowerName == "SFXPower_CombatDrone" || // Player version is way too OP. Enforce NPC version
                        PowerName.Contains("Dominate")    // This is pointless against player squad
                    )
                    )
                {
                    IsUsable = false;
                    return; // Do not use ammo or base powers as they're player only in the usable code
                }

                PackageFileName = Path.GetFileName(export.FileRef.FilePath);
                PackageName     = export.ParentName;
                SourceUIndex    = export.UIndex;

                var hasShaderCache = export.FileRef.FindExport("SeekFreeShaderCache") != null;

                RequiresStartupPackage = hasShaderCache && !export.FileRef.FilePath.Contains("Startup", StringComparison.InvariantCultureIgnoreCase);
                ImportOnly             = hasShaderCache;
                IsCorrectedPackage     = isCorrectedPackage;

                if (hasShaderCache && !IsWhitelistedPower(export))
                {
                    IsUsable = false; // only allow whitelisted DLC powers
                }

                SetupDependencies(export);
            }
Esempio n. 5
0
 public Interaction(PowerName power, Actor target, InteractSuccessCallback success,
                    AIEventCallback callback)
 {
     Power    = power;
     Target   = target;
     Success  = success;
     Callback = callback;
     Started  = DateTime.UtcNow;
 }
            public Talent(ExportEntry powerClass, bool isEvolution = false)
            {
                PowerExport = powerClass;
                IsEvolution = isEvolution;
                var baseClass    = powerClass;
                var baseClassObj = baseClass.GetDefaults().GetProperty <ObjectProperty>("EvolvedPowerClass1");

                while (baseClassObj == null || baseClassObj.Value == 0)
                {
                    baseClass    = (ExportEntry)baseClass.SuperClass;
                    baseClassObj = baseClass.GetDefaults().GetProperty <ObjectProperty>("EvolvedPowerClass1");
                }

                BasePower = baseClass;

                if (BasePower.ObjectName.Name.Contains("Passive"))
                {
                    IsPassive = true;
                }
                else
                {
                    var baseName = baseClass.GetDefaults().GetProperty <NameProperty>("BaseName");
                    while (baseName == null)
                    {
                        baseClass = (ExportEntry)baseClass.SuperClass;
                        baseName  = baseClass.GetDefaults().GetProperty <NameProperty>("BaseName");
                    }

                    BaseName = baseName.Value.Name;
                }

                // Setup name
                var superDefaults    = PowerExport.GetDefaults();
                var displayNameProps = superDefaults.GetProperties();
                var superProps       = displayNameProps;
                var displayName      = superProps.GetProp <StringRefProperty>("DisplayName");

                while (displayName == null)
                {
                    superDefaults = ((superDefaults.Class as ExportEntry).SuperClass as ExportEntry).GetDefaults();
                    superProps    = superDefaults.GetProperties();
                    superProps.GetProp <StringRefProperty>("DisplayName");
                    displayName = superProps.GetProp <StringRefProperty>("DisplayName");
                }
                PowerName = TLKHandler.TLKLookupByLang(displayName.Value, "INT");

                if (IsEvolution)
                {
                    // Setup the blurb
                    var blurbDesc = TLKHandler.TLKLookupByLang(displayNameProps.GetProp <StringRefProperty>("TalentDescription").Value, "INT").Split('\n')[0];
                    EvolvedBlurb = $"{PowerName}: {blurbDesc}";
                }

                IsAmmoPower   = PowerName.Contains("Ammo");
                IsCombatPower = !IsAmmoPower && !IsPassive;
            }
Esempio n. 7
0
 //Checks for collision with the trigger
 void OnTriggerEnter2D(Collider2D collision)
 {
     /* If the player collects the power up,
      * The player will be able to use the power up,
      * and the object will dissapear
      */
     if (collision.CompareTag("Player"))
     {
         hasPower  = true;
         powerName = nameOfP;
         powerTime = timePowerLasts;
         powerUp.SetActive(false);
     }
 }
    void OnTriggerEnter(Collider other)
    {
        if (!isLocalPlayer)
        {
            return;
        }

        if (power || other.gameObject.GetComponent <PickUpBase>() == null)
        {
            return;
        }
        else
        {
            if (other.gameObject.GetComponent <PickUpBase>() != null)
            {
                if (other.gameObject.GetComponent <UnlimitedStamina>() != null)
                {
                    temp = colours[0];
                    pow  = PowerName.UnlimitedStamina;
                }
                else if (other.gameObject.GetComponent <PowerBoost>() != null)
                {
                    temp = colours[1];
                    pow  = PowerName.PowerBoost;
                }
                else if (other.gameObject.GetComponent <WeaponRecharge>() != null)
                {
                    temp = colours[2];
                    pow  = PowerName.WeaponRecharge;
                }
                else if (other.gameObject.GetComponent <NullifyFear>() != null)
                {
                    temp = colours[3];
                    pow  = PowerName.NullifyFear;
                }

                other.gameObject.GetComponent <PickUpBase>().player = gameObject;

                the_pickup = other.gameObject;

                power_name = other.gameObject.name;

                power = true;
            }
        }
    }
Esempio n. 9
0
 public Power(PowerName id, string name, string description)
 {
     Id          = id;
     Name        = name;
     Description = description;
 }
Esempio n. 10
0
 public void UsePower(PowerName power, Vector3f target)
 {
     Injector.UsePower(ActorPtr, AcdPtr, new D3PowerInfo((uint)power, target, WorldID));
 }
Esempio n. 11
0
 public void UsePower(PowerName power, Actor target)
 {
     Injector.UsePower(ActorPtr, AcdPtr, new D3PowerInfo((uint)power, (uint)target.AcdID));
 }
Esempio n. 12
0
 public Skill(PowerName power, float cooldown)
 {
     Power             = power;
     CooldownRemaining = cooldown;
 }
Esempio n. 13
0
 public void UsePower(PowerName power, Vector3f target)
 {
     Injector.UsePower(ActorPtr, AcdPtr, new D3PowerInfo((uint)power, target, WorldID));
 }
Esempio n. 14
0
 public void UsePower(PowerName power, Actor target)
 {
     Injector.UsePower(ActorPtr, AcdPtr, new D3PowerInfo((uint)power, (uint)target.AcdID));
 }