Skip to content

Commit

Permalink
v0.1.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pdcook committed Jun 23, 2021
1 parent fa9d528 commit 1f61c09
Show file tree
Hide file tree
Showing 18 changed files with 238 additions and 394 deletions.
Binary file modified PCE.dll
Binary file not shown.
36 changes: 10 additions & 26 deletions PCE/Cards/DiscombobulateCard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using UnityEngine;
using System.Reflection;
using UnboundLib.Networking;
using System.Linq;

namespace PCE.Cards
{
Expand All @@ -26,7 +27,7 @@ public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, Characte
block.GetAdditionalData().discombobulateDuration += 1f;

block.BlockAction = (Action<BlockTrigger.BlockTriggerType>)Delegate.Combine(block.BlockAction, new Action<BlockTrigger.BlockTriggerType>(this.GetDoBlockAction(player, block)));

}
public Action<BlockTrigger.BlockTriggerType> GetDoBlockAction(Player player, Block block)
{
Expand All @@ -53,30 +54,7 @@ public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, Characte
}
};
}
/*
public void DoBlock(BlockTrigger.BlockTriggerType trigger)
{
Block block = this.GetComponentInParent<Block>();
Player player = this.GetComponent<Player>();
if (trigger != BlockTrigger.BlockTriggerType.None)
{
Vector2 pos = block.transform.position;
Player[] players = PlayerManager.instance.players.ToArray();
for (int i = 0; i < players.Length; i++)
{
// don't apply the effect to the player who activated it...
if (players[i].playerID == player.playerID) { continue; }
// apply to players within range
if (Vector2.Distance(pos, players[i].transform.position) < block.GetAdditionalData().discombobulateRange)
{
NetworkingManager.RPC(typeof(DiscombobulateCard), "OnDiscombobulateActivate", new object[] { players[i].playerID, block.GetAdditionalData().discombobulateDuration });
}
}
}
}*/

public override void OnRemoveCard()
{
}
Expand Down Expand Up @@ -125,9 +103,15 @@ public static void OnDiscombobulateActivate(int playerID, float duration)
BindingFlags.Instance | BindingFlags.InvokeMethod | BindingFlags.NonPublic,
null, PlayerManager.instance, new object[] { playerID });

DiscombobulateEffect thisDiscombobulateEffect = player.gameObject.GetOrAddComponent<DiscombobulateEffect>();
DiscombobulateEffect thisDiscombobulateEffect = player.gameObject.AddComponent<DiscombobulateEffect>();
thisDiscombobulateEffect.SetDuration(duration);
thisDiscombobulateEffect.SetMovementSpeedMultiplier(-1f);
Color yellow = Color.yellow;
float brightness = 0.8f;
yellow.r *= brightness;
yellow.g *= brightness;
yellow.b *= brightness;
thisDiscombobulateEffect.SetColor(new Color(yellow.r, yellow.g, yellow.b, 1f));
thisDiscombobulateEffect.ResetTimer();

}
Expand Down
2 changes: 1 addition & 1 deletion PCE/Cards/FlipCard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, Characte
characterStats.GetAdditionalData().gravityDurationOnDoDamage += 1.5f;
}

player.gameObject.GetOrAddComponent<GravityDealtDamageEffect>();
player.gameObject.AddComponent<GravityDealtDamageEffect>();

}
public override void OnRemoveCard()
Expand Down
2 changes: 1 addition & 1 deletion PCE/Cards/GroundedCard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, Characte
characterStats.GetAdditionalData().gravityDurationOnDoDamage += 2f;
}

player.gameObject.GetOrAddComponent<GravityDealtDamageEffect>();
player.gameObject.AddComponent<GravityDealtDamageEffect>();


}
Expand Down
49 changes: 47 additions & 2 deletions PCE/Cards/LowGroundCard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected override string GetTitle()
}
protected override string GetDescription()
{
return "Increased stats when below an enemy player";
return "Get increased stats when below an enemy player.\nWhen active:";
}

protected override GameObject GetCardArt()
Expand All @@ -57,7 +57,52 @@ protected override CardInfo.Rarity GetRarity()

protected override CardInfoStat[] GetStats()
{
return null;
return new CardInfoStat[]
{
new CardInfoStat
{
positive = true,
stat = "Damage",
amount = "+100%",
simepleAmount = CardInfoStat.SimpleAmount.aHugeAmountOf
},
new CardInfoStat
{
positive = true,
stat = "Bullet Speed",
amount = "+100%",
simepleAmount = CardInfoStat.SimpleAmount.aHugeAmountOf
},
new CardInfoStat
{
positive = true,
stat = "Attack Speed",
amount = "+100%",
simepleAmount = CardInfoStat.SimpleAmount.aHugeAmountOf
},
new CardInfoStat
{
positive = true,
stat = "Ammo",
amount = "+3",
simepleAmount = CardInfoStat.SimpleAmount.Some
},
new CardInfoStat
{
positive = true,
stat = "Reload Speed",
amount = "+25%",
simepleAmount = CardInfoStat.SimpleAmount.Some
},
new CardInfoStat
{
positive = true,
stat = "Movement Speed",
amount = "+100%",
simepleAmount = CardInfoStat.SimpleAmount.aHugeAmountOf
},

};
}
protected override CardThemeColor.CardThemeColorType GetTheme()
{
Expand Down
2 changes: 1 addition & 1 deletion PCE/Cards/MoonShoesCard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ protected override GameObject GetCardArt()

protected override CardInfo.Rarity GetRarity()
{
return CardInfo.Rarity.Uncommon;
return CardInfo.Rarity.Common;
}

protected override CardInfoStat[] GetStats()
Expand Down
2 changes: 1 addition & 1 deletion PCE/Cards/OldJetpackCard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ protected override GameObject GetCardArt()

protected override CardInfo.Rarity GetRarity()
{
return CardInfo.Rarity.Uncommon;
return CardInfo.Rarity.Common;
}

protected override CardInfoStat[] GetStats()
Expand Down
51 changes: 51 additions & 0 deletions PCE/Extensions/TemporaryModifiers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -525,4 +525,55 @@ public void RemoveCharacterStatModifiersModifier(CharacterStatModifiers characte

}
}
public class GravityModifier
{
public float gravityForce_add = 0f;
public float gravityForce_mult = 1f;
public float exponent_add = 0f;
public float exponent_mult = 1f;

private float gravityForce_delta = 0f;
private float exponent_delta = 0f;


public static void ApplyGravityModifier(GravityModifier gravityModifier, Gravity gravity)
{
gravityModifier.gravityForce_delta = gravity.gravityForce * gravityModifier.gravityForce_mult + gravityModifier.gravityForce_add - gravity.gravityForce;
gravityModifier.exponent_delta = gravity.exponent * gravityModifier.exponent_mult + gravityModifier.exponent_add - gravity.exponent;

gravity.gravityForce += gravityModifier.gravityForce_delta;
gravity.exponent += gravityModifier.exponent_delta;

}
public void ApplyGravityModifier(Gravity gravity)
{
this.gravityForce_delta = gravity.gravityForce * this.gravityForce_mult + this.gravityForce_add - gravity.gravityForce;
this.exponent_delta = gravity.exponent * this.exponent_mult + this.exponent_add - gravity.exponent;

gravity.gravityForce += this.gravityForce_delta;
gravity.exponent += this.exponent_delta;

}
public static void RemoveGravityModifier(GravityModifier gravityModifier, Gravity gravity)
{

gravity.gravityForce -= gravityModifier.gravityForce_delta;
gravity.exponent -= gravityModifier.exponent_delta;

gravityModifier.gravityForce_delta = 0f;
gravityModifier.exponent_delta = 0f;

}
public void RemoveGravityModifier(Gravity gravity)
{

gravity.gravityForce -= this.gravityForce_delta;
gravity.exponent -= this.exponent_delta;

this.gravityForce_delta = 0f;
this.exponent_delta = 0f;

}

}
}
Expand Down
114 changes: 0 additions & 114 deletions PCE/MonoBehaviours/CharacterStatModifiersEffect.cs

This file was deleted.

3 changes: 1 addition & 2 deletions PCE/MonoBehaviours/DemonicPossessionEffect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,8 @@ public void Destroy()

public List<MonoBehaviour> Effect_NoGravityEffect(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
GravityEffect effect = player.gameObject.GetOrAddComponent<GravityEffect>();
GravityEffect effect = player.gameObject.AddComponent<GravityEffect>();
effect.SetGravityForceMultiplier(0f);
effect.SetDuration(this.effectDuration);
return new List<MonoBehaviour> { effect };
}
public List<MonoBehaviour> Effect_InvisibleEffect(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
Expand Down
Loading

0 comments on commit 1f61c09

Please sign in to comment.