Skip to content

Commit

Permalink
storying L2SkillEffect into Skill object
Browse files Browse the repository at this point in the history
  • Loading branch information
shnok committed Sep 27, 2024
1 parent cd1f3de commit 93cff7a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 78 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,32 +44,6 @@ private AttachOnType ParseAttachOnType(string attachOn)
}

return (AttachOnType)Enum.Parse(typeof(AttachOnType), attachOn.ToUpper());

// switch (attachOn)
// {
// case "AM_None":
// return AttachOnType.AM_None;
// case "AM_Location":
// return AttachOnType.AM_Location;
// case "AM_RH":
// return AttachOnType.AM_RH;
// case "AM_LH":
// return AttachOnType.AM_LH;
// case "AM_RA":
// return AttachOnType.AM_RA;
// case "AM_LA":
// return AttachOnType.AM_LA;
// case "AM_WING":
// return AttachOnType.AM_WING;
// case "AM_BoneSpecified":
// return AttachOnType.AM_BoneSpecified;
// case "AM_AliasSpecified":
// return AttachOnType.AM_AliasSpecified;
// case "AM_Trail":
// return AttachOnType.AM_Trail;
// default:
// return AttachOnType.AM_None;
// }
}


Expand All @@ -81,28 +55,6 @@ private EtcEffect ParseEtcEffect(string etcEffect)
}

return (EtcEffect)Enum.Parse(typeof(EtcEffect), etcEffect.ToUpper());

// switch (etcEffect)
// {
// case "EET_None":
// return EtcEffect.EET_None;
// case "EET_FireCracker":
// return EtcEffect.EET_FireCracker;
// case "EET_Soulshot":
// return EtcEffect.EET_Soulshot;
// case "EET_SpiritShot":
// return EtcEffect.EET_SpiritShot;
// case "EET_Cubic":
// return EtcEffect.EET_Cubic;
// case "EET_SoundCrystal":
// return EtcEffect.EET_SoundCrystal;
// case "EET_JewelShot":
// return EtcEffect.EET_JewelShot;
// case "EET_PetJewelShot":
// return EtcEffect.EET_PetJewelShot;
// default:
// return EtcEffect.EET_None;
// }
}

private EtcEffectInfo ParseEtcEffectInfo(string etcEffectInfo)
Expand All @@ -113,32 +65,6 @@ private EtcEffectInfo ParseEtcEffectInfo(string etcEffectInfo)
}

return (EtcEffectInfo)Enum.Parse(typeof(EtcEffectInfo), etcEffectInfo.ToUpper());

// switch (etcEffectInfo)
// {
// case "EEP_None":
// return EtcEffectInfo.EEP_None;
// case "EEP_FireCrackerSmall":
// return EtcEffectInfo.EEP_FireCrackerSmall;
// case "EEP_FireCrackerMiddle":
// return EtcEffectInfo.EEP_FireCrackerMiddle;
// case "EEP_FireCrackerLarge":
// return EtcEffectInfo.EEP_FireCrackerLarge;
// case "EEP_GradeNone":
// return EtcEffectInfo.EEP_GradeNone;
// case "EEP_GradeD":
// return EtcEffectInfo.EEP_GradeD;
// case "EEP_GradeC":
// return EtcEffectInfo.EEP_GradeC;
// case "EEP_GradeB":
// return EtcEffectInfo.EEP_GradeB;
// case "EEP_GradeA":
// return EtcEffectInfo.EEP_GradeA;
// case "EEP_GradeS":
// return EtcEffectInfo.EEP_GradeS;
// default:
// return EtcEffectInfo.EEP_None;
// }
}

public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
Expand Down
10 changes: 8 additions & 2 deletions l2-unity/Assets/Scripts/Datatable/Json/SkillEffectTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,23 @@ public void CacheEffects()

foreach (KeyValuePair<int, Skill> kvp in SkillTable.Instance.Skills)
{
if (SkillEffects.ContainsKey(kvp.Key))
if (kvp.Value.EffectId == -1)
{
continue;
}

if (SkillEffects.TryGetValue(kvp.Key, out L2SkillEffect value))
{
kvp.Value.SkillEffect = value;
continue;
}

L2SkillEffect skillEffect = ParseEffectId(kvp.Value.EffectId);

if (skillEffect != null)
{
SkillEffects.TryAdd(kvp.Value.EffectId, skillEffect);
kvp.Value.SkillEffect = skillEffect;
}
}
}
Expand All @@ -59,7 +66,6 @@ private L2SkillEffect ParseEffectId(int id)
using (StreamReader reader = new StreamReader(dataPath))
{
L2SkillEffect skillEffect = ParseL2SkillEffect(reader.ReadToEnd());
GameManager.Instance.debugEffect = skillEffect;

return skillEffect;
}
Expand Down
2 changes: 0 additions & 2 deletions l2-unity/Assets/Scripts/Game/Manager/GameManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ public class GameManager : MonoBehaviour
[SerializeField] private bool _autoLogin = false;
[SerializeField] private Camera _loadingCamera;

[SerializeField] public L2SkillEffect debugEffect;

public bool AutoLogin { get { return _autoLogin; } }

public GameState GameState
Expand Down

0 comments on commit 93cff7a

Please sign in to comment.