Files
test/Assets/PerfectWorld/Scripts/Skills/skill4.cs
T
2025-11-12 10:52:37 +07:00

316 lines
7.3 KiB
C#

#define SKILL_CLIENT
using BrewMonster.Scripts.Skills;
using System.Text;
using UnityEngine;
using static BrewMonster.PET_EVOLVE_CONFIG;
namespace BrewMonster
{
#if SKILL_SERVER
public class Skill4 : Skill
{
public const int SKILL_ID = 4;
public Skill4() : base(SKILL_ID)
{
}
}
#endif
public class Skill4Stub : SkillStub
{
// Static arrays for skill requirements
private static readonly int[] RequiredLevelArray = { 23, 28, 33, 38, 43, 48, 53, 58, 63, 68 };
private static readonly int[] RequiredSpArray = { 7000, 10900, 16100, 23000, 32000, 44100, 60200, 81800, 111000, 151000 };
private static readonly int[] RequiredMoneyArray = { 630, 1000, 1450, 1900, 2380, 2880, 3380, 3880, 10980, 41980 };
#if SKILL_SERVER
public class State1 : SkillStub.State
{
public int GetTime(Skill skill)
{
return 600;
}
public bool Quit(Skill skill)
{
return false;
}
public bool Loop(Skill skill)
{
return false;
}
public bool Bypass(Skill skill)
{
return false;
}
public void Calculate(Skill skill)
{
skill.GetPlayer().SetDecmp(0.2f * (35.3f + 9.8f * skill.GetLevel()));
skill.GetPlayer().SetPray(1);
}
public bool Interrupt(Skill skill)
{
return false;
}
public bool Cancel(Skill skill)
{
return true;
}
public bool Skip(Skill skill)
{
return false;
}
}
#endif
#if SKILL_SERVER
public class State2 : SkillStub.State
{
public int GetTime(Skill skill)
{
return 1800;
}
public bool Quit(Skill skill)
{
return false;
}
public bool Loop(Skill skill)
{
return false;
}
public bool Bypass(Skill skill)
{
return false;
}
public void Calculate(Skill skill)
{
skill.GetPlayer().SetDecmp(0.8f * (35.3f + 9.8f * skill.GetLevel()));
skill.GetPlayer().SetPerform(1);
}
public bool Interrupt(Skill skill)
{
return false;
}
public bool Cancel(Skill skill)
{
return false;
}
public bool Skip(Skill skill)
{
return false;
}
}
#endif
#if SKILL_SERVER
public class State3 : SkillStub.State
{
public int GetTime(Skill skill)
{
return 0;
}
public bool Quit(Skill skill)
{
return false;
}
public bool Loop(Skill skill)
{
return false;
}
public bool Bypass(Skill skill)
{
return false;
}
public void Calculate(Skill skill)
{
}
public bool Interrupt(Skill skill)
{
return false;
}
public bool Cancel(Skill skill)
{
return false;
}
public bool Skip(Skill skill)
{
return false;
}
}
#endif
public Skill4Stub() : base(4)
{
cls = 0;
name = "狮子吼";
nativename = "狮子吼";
icon = "狮子吼.dds";
max_level = 10;
type = 3;
apcost = 35;
arrowcost = 0;
apgain = 0;
attr = 1;
rank = 2;
eventflag = 0;
posdouble = 0;
clslimit = 0;
time_type = 0;
showorder = 1126;
allow_land = true;
allow_air = true;
allow_water = true;
allow_ride = false;
auto_attack = false;
long_range = 0;
restrict_corpse = 0;
allow_forms = 1;
restrict_weapons.Add(0);
restrict_weapons.Add(1);
restrict_weapons.Add(182);
restrict_weapons.Add(5);
restrict_weapons.Add(292);
restrict_weapons.Add(9);
effect = "狮子吼.sgc";
range = new Range();
range.type = 2;
doenchant = 1;
dobless = 0;
commoncooldown = 0;
commoncooldowntime = 0;
#if SKILL_SERVER
statestub.Add(new State1());
statestub.Add(new State2());
statestub.Add(new State3());
#endif
}
~Skill4Stub()
{
}
public float GetMpcost(Skill skill)
{
return (float)(35.3 + 9.8 * skill.GetLevel());
}
public int GetExecutetime(Skill skill)
{
return 1800;
}
public int GetCoolingtime(Skill skill)
{
return 25000 - 1000 * skill.GetLevel();
}
public int GetRequiredLevel(Skill skill)
{
return RequiredLevelArray[skill.GetLevel() - 1];
}
public int GetRequiredSp(Skill skill)
{
return RequiredSpArray[skill.GetLevel() - 1];
}
public int GetRequiredMoney(Skill skill)
{
return RequiredMoneyArray[skill.GetLevel() - 1];
}
public float GetRadius(Skill skill)
{
return 10f;
}
public float GetAttackdistance(Skill skill)
{
return 0f;
}
public float GetAngle(Skill skill)
{
return (float)(1 - 0.0111111 * 0);
}
public float GetPraydistance(Skill skill)
{
return 5f;
}
#if SKILL_CLIENT
public int GetIntroduction(Skill skill, StringBuilder buffer, int length, string format)
{
string result = string.Format(format,
skill.GetLevel(),
35.3 + 9.8 * skill.GetLevel(),
25 - skill.GetLevel(),
3 + 0.3 * skill.GetLevel());
if (result.Length < length)
{
buffer.Append(result);
return result.Length;
}
return 0;
}
#endif
#if SKILL_SERVER
public int GetEnmity(Skill skill)
{
return 600 * skill.GetLevel();
}
public bool StateAttack(Skill skill)
{
skill.GetVictim().SetProbability(1.0f * (85 + skill.GetLevel()));
skill.GetVictim().SetTime(4000 + 300 * skill.GetLevel());
skill.GetVictim().SetDizzy(1);
return true;
}
public bool TakeEffect(Skill skill)
{
return true;
}
public float GetEffectdistance(Skill skill)
{
return 20f;
}
public int GetAttackspeed(Skill skill)
{
return 9;
}
public float GetHitrate(Skill skill)
{
return 1f;
}
#endif
}
}