migration from new repo
This commit is contained in:
commit
423134a840
26930 changed files with 3458568 additions and 0 deletions
14
Assets/_/Features/Quests/Runtime/Events/EnemyTag.cs
Normal file
14
Assets/_/Features/Quests/Runtime/Events/EnemyTag.cs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
namespace Quests.Runtime
|
||||
{
|
||||
public enum EnemyTag
|
||||
{
|
||||
Orc,
|
||||
Troll,
|
||||
Rats,
|
||||
Wolves,
|
||||
Gobelins,
|
||||
Bandits,
|
||||
Dragon,
|
||||
Skeleton,
|
||||
}
|
||||
}
|
||||
3
Assets/_/Features/Quests/Runtime/Events/EnemyTag.cs.meta
Normal file
3
Assets/_/Features/Quests/Runtime/Events/EnemyTag.cs.meta
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 139a5d5fdd68466bbef3d9f7da5594e8
|
||||
timeCreated: 1754469899
|
||||
12
Assets/_/Features/Quests/Runtime/Events/EnvironmentTag.cs
Normal file
12
Assets/_/Features/Quests/Runtime/Events/EnvironmentTag.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
namespace Quests.Runtime
|
||||
{
|
||||
public enum EnvironmentTag
|
||||
{
|
||||
Plain,
|
||||
Cave,
|
||||
Forest,
|
||||
Mountain,
|
||||
Town,
|
||||
Hamlett
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 823fcc8915904618b4f5a7ce5ed7904b
|
||||
timeCreated: 1754469713
|
||||
41
Assets/_/Features/Quests/Runtime/Events/EventEffect.cs
Normal file
41
Assets/_/Features/Quests/Runtime/Events/EventEffect.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
using System;
|
||||
|
||||
namespace Quests.Runtime
|
||||
{
|
||||
public enum EffectType
|
||||
{
|
||||
Damage,
|
||||
Heal,
|
||||
Gold,
|
||||
Buff,
|
||||
Debuff,
|
||||
ItemLoss,
|
||||
Custom
|
||||
}
|
||||
|
||||
public enum TargetingType
|
||||
{
|
||||
RandomHero,
|
||||
AllHeroes,
|
||||
LowestHp,
|
||||
HighestHp,
|
||||
LowestMana,
|
||||
HighestMana,
|
||||
LowestDefense,
|
||||
HighestDefense,
|
||||
LowestXp,
|
||||
HighestXp,
|
||||
SpecificClass,
|
||||
None
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public struct EventEffect
|
||||
{
|
||||
public EffectType Type;
|
||||
public int Value;
|
||||
public TargetingType Target;
|
||||
public string ExtraData;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 67a2bafafa7b4f0386e42266a80b84fc
|
||||
timeCreated: 1754470856
|
||||
89
Assets/_/Features/Quests/Runtime/Events/QuestEvent.cs
Normal file
89
Assets/_/Features/Quests/Runtime/Events/QuestEvent.cs
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Adventurer.Runtime;
|
||||
using Core.Runtime;
|
||||
using Newtonsoft.Json;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Quests.Runtime
|
||||
{
|
||||
[Serializable]
|
||||
public class QuestEvent
|
||||
{
|
||||
#region Parameters
|
||||
|
||||
Guid _id;
|
||||
[SerializeField] string _descriptionKey;
|
||||
|
||||
[SerializeField] QuestEventType _type;
|
||||
[SerializeField] List<EnvironmentTag> _environments;
|
||||
[SerializeField] List<EnemyTag> _enemyTags;
|
||||
|
||||
[SerializeField] int _minLevel;
|
||||
[SerializeField] int _minTimeTrigger;
|
||||
[SerializeField] int _maxTimeTrigger;
|
||||
[SerializeField] float _percentTrigger;
|
||||
|
||||
[SerializeField] List<EventEffect> _effects;
|
||||
[SerializeField] TargetingType _targetingTypes;
|
||||
|
||||
int _time;
|
||||
|
||||
#endregion
|
||||
|
||||
// Optionnel : getters publics si tu veux exposer ça sans accès direct à la modif
|
||||
public Guid Id => _id;
|
||||
[JsonIgnore] public string DescriptionKey => _descriptionKey;
|
||||
[JsonIgnore] public QuestEventType Type => _type;
|
||||
[JsonIgnore] public List<EnvironmentTag> Environments => _environments;
|
||||
[JsonIgnore] public List<EnemyTag> EnemyTags => _enemyTags;
|
||||
[JsonIgnore]public int MinLevel => _minLevel;
|
||||
[JsonIgnore]public int MinTimeTrigger => _minTimeTrigger;
|
||||
[JsonIgnore]public int MaxTimeTrigger => _maxTimeTrigger;
|
||||
[JsonIgnore]public float PercentTrigger => _percentTrigger;
|
||||
[JsonIgnore] public List<EventEffect> Effects => _effects;
|
||||
[JsonIgnore] public TargetingType TargetingTypes => _targetingTypes;
|
||||
|
||||
public int Time
|
||||
{
|
||||
get { return _time; }
|
||||
set { _time = value; }
|
||||
}
|
||||
|
||||
public QuestEvent(Guid id, QuestEventSO data, int time)
|
||||
{
|
||||
_id = id;
|
||||
_descriptionKey = data.m_data.DescriptionKey;
|
||||
_environments = data.m_data.Environments;
|
||||
_enemyTags = data.m_data.EnemyTags;
|
||||
_minLevel = data.m_data.MinLevel;
|
||||
_minTimeTrigger = data.m_data.MinTimeTrigger;
|
||||
_maxTimeTrigger = data.m_data.MaxTimeTrigger;
|
||||
_percentTrigger = data.m_data.PercentTrigger;
|
||||
_effects = data.m_data.Effects;
|
||||
_targetingTypes = data.m_data.TargetingTypes;
|
||||
_time = time;
|
||||
}
|
||||
|
||||
public List<AdventurerClass> GetTargets(List<Guid> assignedAdventurersById)
|
||||
{
|
||||
List<AdventurerClass> assignedAdventurers = QuestClass.GetAdventurersFromId(assignedAdventurersById);
|
||||
switch (_targetingTypes)
|
||||
{
|
||||
case TargetingType.AllHeroes:
|
||||
return assignedAdventurers;
|
||||
case TargetingType.RandomHero:
|
||||
return new List<AdventurerClass> { assignedAdventurers[UnityEngine.Random.Range(0, assignedAdventurers.Count)] };
|
||||
case TargetingType.LowestHp:
|
||||
return assignedAdventurers
|
||||
.OrderBy(adventurer => adventurer.Health)
|
||||
.Take(1)
|
||||
.ToList();
|
||||
case TargetingType.None:
|
||||
default:
|
||||
return new List<AdventurerClass>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ed74403db8734b009db10b835931a998
|
||||
timeCreated: 1754468616
|
||||
17
Assets/_/Features/Quests/Runtime/Events/QuestEventLog.cs
Normal file
17
Assets/_/Features/Quests/Runtime/Events/QuestEventLog.cs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Quests.Runtime
|
||||
{
|
||||
[Serializable]
|
||||
public class QuestEventLog
|
||||
{
|
||||
public int Time;
|
||||
public Guid EventId;
|
||||
public QuestEventLog(int time, Guid eventId)
|
||||
{
|
||||
Time = time;
|
||||
EventId = eventId;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1a935b81171d40728387513eabf54a0b
|
||||
timeCreated: 1754733198
|
||||
13
Assets/_/Features/Quests/Runtime/Events/QuestEventPackSO.cs
Normal file
13
Assets/_/Features/Quests/Runtime/Events/QuestEventPackSO.cs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Quests.Runtime
|
||||
{
|
||||
[CreateAssetMenu(fileName = "QuestEventPack", menuName = "Guild Tycoon/Quests/EventPack", order = 0)]
|
||||
public class QuestEventPackSO : ScriptableObject
|
||||
{
|
||||
|
||||
public List<QuestEventSO> availableEvents;
|
||||
public int maxEventsToPick = 2;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: fd9a61ac0c734fa49cf904db67dc4644
|
||||
timeCreated: 1754473539
|
||||
32
Assets/_/Features/Quests/Runtime/Events/QuestEventSO.cs
Normal file
32
Assets/_/Features/Quests/Runtime/Events/QuestEventSO.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Quests.Runtime
|
||||
{
|
||||
[CreateAssetMenu(fileName = "QuestEventSO", menuName = "Guild Tycoon/Quests/Event", order = 0)]
|
||||
public class QuestEventSO : ScriptableObject
|
||||
{
|
||||
[SerializeField] string m_assetGuid;
|
||||
public QuestEvent m_data;
|
||||
public Guid AssetGuid => Guid.Parse(m_assetGuid);
|
||||
|
||||
public QuestEvent ToQuestEventClass(int time, Guid? id = null)
|
||||
{
|
||||
QuestEvent eventQuest = new QuestEvent(AssetGuid, this, time);
|
||||
|
||||
return eventQuest;
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
private void OnValidate()
|
||||
{
|
||||
Guid tempGuid;
|
||||
if (string.IsNullOrEmpty(m_assetGuid) || !Guid.TryParse(m_assetGuid, out tempGuid))
|
||||
{
|
||||
m_assetGuid = Guid.NewGuid().ToString();
|
||||
UnityEditor.EditorUtility.SetDirty(this);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e985bf205d4d456cac619ec3ff4104e1
|
||||
timeCreated: 1754468370
|
||||
14
Assets/_/Features/Quests/Runtime/Events/QuestEventType.cs
Normal file
14
Assets/_/Features/Quests/Runtime/Events/QuestEventType.cs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
namespace Quests.Runtime
|
||||
{
|
||||
public enum QuestEventType
|
||||
{
|
||||
Fight,
|
||||
Narrative,
|
||||
Hazard,
|
||||
Reward,
|
||||
Curse,
|
||||
Buff,
|
||||
Interaction,
|
||||
Special
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 5f8715462e744f8e81cd0a880ec265a9
|
||||
timeCreated: 1754469608
|
||||
Loading…
Add table
Add a link
Reference in a new issue