Compare commits
No commits in common. "a26d0acbfb0ce55732a1e41a56879fc795d848f3" and "db9c828e63c3c26392c9c86e6f43ebf7c3b94a43" have entirely different histories.
a26d0acbfb
...
db9c828e63
13 changed files with 3 additions and 116 deletions
|
|
@ -25,7 +25,7 @@ MonoBehaviour:
|
||||||
areaSound:
|
areaSound:
|
||||||
clip: {fileID: 8300000, guid: 038ff3eab9aa0034bac26ccb648ef2a1, type: 3}
|
clip: {fileID: 8300000, guid: 038ff3eab9aa0034bac26ccb648ef2a1, type: 3}
|
||||||
volume: 0.632
|
volume: 0.632
|
||||||
minPitch: 1.04
|
minPitch: 1.14
|
||||||
maxPitch: 0.96
|
maxPitch: 0.96
|
||||||
SlowFactor: 0.5
|
SlowFactor: 0.5
|
||||||
EffectDuration: 8
|
EffectDuration: 8
|
||||||
|
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
%YAML 1.1
|
|
||||||
%TAG !u! tag:unity3d.com,2011:
|
|
||||||
--- !u!114 &11400000
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 0}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: 37cc60a4a6e53e24cb6d1c0be310868a, type: 3}
|
|
||||||
m_Name: SlowAreaUpgradedSpell
|
|
||||||
m_EditorClassIdentifier: Assembly-CSharp::TD.Gameplay.BuilderSpells.SlowAreaUpgradedSpellDefinition
|
|
||||||
DisplayName: Slow Area II
|
|
||||||
Description: Upgraded Slow Area. Slows for 50% longer.
|
|
||||||
Icon: {fileID: 0}
|
|
||||||
Cooldown: 10
|
|
||||||
TargetType: 1
|
|
||||||
Radius: 5
|
|
||||||
enemyLayerMask:
|
|
||||||
serializedVersion: 2
|
|
||||||
m_Bits: 1152
|
|
||||||
areaVfxPrefab: {fileID: 1462673130280185047, guid: bf2f1f2a9a54e9162b80673e3f7eeaf6, type: 3}
|
|
||||||
areaSound:
|
|
||||||
clip: {fileID: 8300000, guid: 038ff3eab9aa0034bac26ccb648ef2a1, type: 3}
|
|
||||||
volume: 0.632
|
|
||||||
minPitch: 1.04
|
|
||||||
maxPitch: 0.96
|
|
||||||
SlowFactor: 0.5
|
|
||||||
EffectDuration: 12
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 364edf6abc3c31e33b53d0a01142b8ab
|
|
||||||
NativeFormatImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
mainObjectFileID: 11400000
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
%YAML 1.1
|
|
||||||
%TAG !u! tag:unity3d.com,2011:
|
|
||||||
--- !u!114 &11400000
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 0}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: 7b1c5b562f39c72eea3bafd0165af078, type: 3}
|
|
||||||
m_Name: Draft_BuilderSpellOption_SlowAreaUpgrade
|
|
||||||
m_EditorClassIdentifier: Assembly-CSharp::TD.Gameplay.Draft.BuilderSpellUpgradeDraftOption
|
|
||||||
DisplayName: Slow Area II
|
|
||||||
Description: Slows enemies in the area for 50% longer than the default slow area.
|
|
||||||
Icon: {fileID: 0}
|
|
||||||
Weight: 1
|
|
||||||
BaseKind: 1
|
|
||||||
UpgradedKind: 2
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: d180030b68a9a5e1da497bf6f83451d4
|
|
||||||
NativeFormatImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
mainObjectFileID: 11400000
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
|
@ -13428,7 +13428,6 @@ MonoBehaviour:
|
||||||
spells:
|
spells:
|
||||||
- {fileID: 11400000, guid: 051c48f416e5366b59d49b0e062333ac, type: 2}
|
- {fileID: 11400000, guid: 051c48f416e5366b59d49b0e062333ac, type: 2}
|
||||||
- {fileID: 11400000, guid: d893f46b037536b4ba91307e184cecfe, type: 2}
|
- {fileID: 11400000, guid: d893f46b037536b4ba91307e184cecfe, type: 2}
|
||||||
- {fileID: 11400000, guid: 364edf6abc3c31e33b53d0a01142b8ab, type: 2}
|
|
||||||
--- !u!4 &914832726
|
--- !u!4 &914832726
|
||||||
Transform:
|
Transform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -28787,7 +28786,6 @@ MonoBehaviour:
|
||||||
- {fileID: 11400000, guid: 65ff25c1c8a89f7df8e88f71968c1c98, type: 2}
|
- {fileID: 11400000, guid: 65ff25c1c8a89f7df8e88f71968c1c98, type: 2}
|
||||||
- {fileID: 11400000, guid: 5f390de69ba43b2a6a0d89cf09580320, type: 2}
|
- {fileID: 11400000, guid: 5f390de69ba43b2a6a0d89cf09580320, type: 2}
|
||||||
- {fileID: 11400000, guid: 29b35841f7e5db454903798cb5d83434, type: 2}
|
- {fileID: 11400000, guid: 29b35841f7e5db454903798cb5d83434, type: 2}
|
||||||
- {fileID: 11400000, guid: d180030b68a9a5e1da497bf6f83451d4, type: 2}
|
|
||||||
--- !u!4 &2139601601
|
--- !u!4 &2139601601
|
||||||
Transform:
|
Transform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,5 @@ namespace TD.Core
|
||||||
{
|
{
|
||||||
Fireball = 0,
|
Fireball = 0,
|
||||||
SlowArea = 1,
|
SlowArea = 1,
|
||||||
SlowAreaUpgraded = 2,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
// Assets/_Project/Scripts/Gameplay/BuilderSpells/SlowAreaUpgradedSpellDefinition.cs
|
|
||||||
|
|
||||||
using TD.Core;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace TD.Gameplay.BuilderSpells
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Draft upgrade for <see cref="SlowAreaSpellDefinition"/> — identical behavior, just a
|
|
||||||
/// distinct <see cref="BuilderSpellKind"/> so <see
|
|
||||||
/// cref="TD.Gameplay.Draft.BuilderSpellUpgradeDraftOption"/> can replace the base spell
|
|
||||||
/// with this one in the player's loadout. All fields (SlowFactor, EffectDuration, etc.)
|
|
||||||
/// are inherited; author this asset with a longer EffectDuration than the base spell.
|
|
||||||
/// </summary>
|
|
||||||
[CreateAssetMenu(fileName = "SlowAreaUpgradedSpell",
|
|
||||||
menuName = "TD/Builder Spells/Slow Area (Upgraded)")]
|
|
||||||
public class SlowAreaUpgradedSpellDefinition : SlowAreaSpellDefinition
|
|
||||||
{
|
|
||||||
public override BuilderSpellKind Kind => BuilderSpellKind.SlowAreaUpgraded;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 37cc60a4a6e53e24cb6d1c0be310868a
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 717648113e8090fc6856744d898ab375
|
|
||||||
|
|
@ -15,9 +15,7 @@ namespace TD.Gameplay.Draft
|
||||||
/// <see cref="PlayerSpellLoadout"/> and <see cref="BuilderSpellPool"/> already key off of.
|
/// <see cref="PlayerSpellLoadout"/> and <see cref="BuilderSpellPool"/> already key off of.
|
||||||
/// <see cref="IsValidFor"/> also checks slot capacity — once
|
/// <see cref="IsValidFor"/> also checks slot capacity — once
|
||||||
/// <see cref="PlayerSpellLoadout.MaxSpellSlots"/> is reached, no further spell options are
|
/// <see cref="PlayerSpellLoadout.MaxSpellSlots"/> is reached, no further spell options are
|
||||||
/// offered. Gates on <see cref="PlayerSpellLoadout.PlayerHasEverGranted"/> rather than
|
/// offered.
|
||||||
/// current possession, so a base spell already upgraded past (see
|
|
||||||
/// <see cref="BuilderSpellUpgradeDraftOption"/>) is never re-offered.
|
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
[CreateAssetMenu(fileName = "BuilderSpellOption", menuName = "TD/Draft/Builder Spell Option")]
|
[CreateAssetMenu(fileName = "BuilderSpellOption", menuName = "TD/Draft/Builder Spell Option")]
|
||||||
public class BuilderSpellDraftOption : DraftOption
|
public class BuilderSpellDraftOption : DraftOption
|
||||||
|
|
@ -31,7 +29,7 @@ namespace TD.Gameplay.Draft
|
||||||
var loadout = PlayerSpellLoadout.GetForClient(clientId);
|
var loadout = PlayerSpellLoadout.GetForClient(clientId);
|
||||||
if (loadout == null) return false;
|
if (loadout == null) return false;
|
||||||
if (loadout.SlotCount >= PlayerSpellLoadout.MaxSpellSlots) return false;
|
if (loadout.SlotCount >= PlayerSpellLoadout.MaxSpellSlots) return false;
|
||||||
return !loadout.PlayerHasEverGranted(Kind);
|
return !loadout.PlayerHasSpell(Kind);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool ServerApply(ulong clientId)
|
public override bool ServerApply(ulong clientId)
|
||||||
|
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
fileFormatVersion: 2
|
|
||||||
guid: 7b1c5b562f39c72eea3bafd0165af078
|
|
||||||
|
|
@ -60,10 +60,6 @@ namespace TD.Gameplay
|
||||||
|
|
||||||
private readonly NetworkList<SpellSlot> spells = new NetworkList<SpellSlot>();
|
private readonly NetworkList<SpellSlot> spells = new NetworkList<SpellSlot>();
|
||||||
|
|
||||||
// Every kind ever granted this match, including ones since upgraded away. Unlike
|
|
||||||
// `spells`, entries here are never removed — see PlayerHasEverGranted.
|
|
||||||
private readonly NetworkList<byte> everGrantedKinds = new NetworkList<byte>();
|
|
||||||
|
|
||||||
/// <summary>Fired on every peer when a spell is granted or a cooldown changes.</summary>
|
/// <summary>Fired on every peer when a spell is granted or a cooldown changes.</summary>
|
||||||
public event System.Action OnLoadoutChanged;
|
public event System.Action OnLoadoutChanged;
|
||||||
|
|
||||||
|
|
@ -104,14 +100,6 @@ namespace TD.Gameplay
|
||||||
public BuilderSpellKind? GetKind(int slot)
|
public BuilderSpellKind? GetKind(int slot)
|
||||||
=> (slot >= 0 && slot < spells.Count) ? spells[slot].Kind : (BuilderSpellKind?)null;
|
=> (slot >= 0 && slot < spells.Count) ? spells[slot].Kind : (BuilderSpellKind?)null;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// True if this player has ever been granted the given spell this match, whether or
|
|
||||||
/// not it's still occupying a slot (e.g. it may have since been upgraded away). Used
|
|
||||||
/// by <see cref="TD.Gameplay.Draft.BuilderSpellDraftOption"/> so a base spell already
|
|
||||||
/// upgraded past is never re-offered.
|
|
||||||
/// </summary>
|
|
||||||
public bool PlayerHasEverGranted(BuilderSpellKind kind) => everGrantedKinds.Contains((byte)kind);
|
|
||||||
|
|
||||||
/// <summary>True if <paramref name="slot"/> is out of range, empty, or still cooling down.</summary>
|
/// <summary>True if <paramref name="slot"/> is out of range, empty, or still cooling down.</summary>
|
||||||
public bool IsSlotOnCooldown(int slot)
|
public bool IsSlotOnCooldown(int slot)
|
||||||
{
|
{
|
||||||
|
|
@ -148,7 +136,6 @@ namespace TD.Gameplay
|
||||||
if (PlayerHasSpell(kind)) return false;
|
if (PlayerHasSpell(kind)) return false;
|
||||||
|
|
||||||
spells.Add(SpellSlot.CreateReady(kind));
|
spells.Add(SpellSlot.CreateReady(kind));
|
||||||
if (!everGrantedKinds.Contains((byte)kind)) everGrantedKinds.Add((byte)kind);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -168,7 +155,6 @@ namespace TD.Gameplay
|
||||||
if (spells[i].Kind == oldKind)
|
if (spells[i].Kind == oldKind)
|
||||||
{
|
{
|
||||||
spells[i] = SpellSlot.CreateReady(newKind);
|
spells[i] = SpellSlot.CreateReady(newKind);
|
||||||
if (!everGrantedKinds.Contains((byte)newKind)) everGrantedKinds.Add((byte)newKind);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue