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

319 lines
7.5 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 Skill2 : Skill
{
public const int SKILL_ID = 2;
public Skill2() : base(SKILL_ID)
{
}
}
#endif
public class Skill2Stub : SkillStub
{
// Static arrays for skill requirements
private static readonly int[] RequiredLevelArray = { 3, 8, 13, 18, 23, 28, 33, 38, 43, 48 };
private static readonly int[] RequiredSpArray = { 100, 800, 2100, 4100, 7000, 10900, 16100, 23000, 32000, 44100 };
private static readonly int[] RequiredMoneyArray = { 10, 90, 220, 400, 630, 1000, 1450, 1900, 2380, 2880 };
#if SKILL_SERVER
public class State1 : SkillStub.State
{
public int GetTime(Skill skill)
{
return 200;
}
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 * (-2.2f + 5.6f * 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 700;
}
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 * (-2.2f + 5.6f * skill.GetLevel()));
skill.SetPlus(0);
skill.SetRatio(0);
skill.SetDamage(skill.GetAttack());
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 Skill2Stub() : base(2)
{
cls = 0;
name = "寸力";
nativename = "寸力";
icon = "寸力.dds";
max_level = 10;
type = 1;
apcost = 0;
arrowcost = 0;
apgain = 5;
attr = 1;
rank = 0;
eventflag = 0;
posdouble = 0;
clslimit = 0;
time_type = 0;
showorder = 1102;
allow_land = true;
allow_air = true;
allow_water = true;
allow_ride = false;
auto_attack = true;
long_range = 0;
restrict_corpse = 0;
allow_forms = 1;
restrict_weapons.Add(0);
restrict_weapons.Add(1);
restrict_weapons.Add(182);
restrict_weapons.Add(9);
restrict_weapons.Add(5);
restrict_weapons.Add(292);
effect = "寸力.sgc";
range = new Range();
range.type = 0;
doenchant = 1;
dobless = 0;
commoncooldown = 0;
commoncooldowntime = 0;
#if SKILL_SERVER
statestub.Add(new State1());
statestub.Add(new State2());
statestub.Add(new State3());
#endif
}
~Skill2Stub()
{
}
public float GetMpcost(Skill skill)
{
return (float)(-2.2 + 5.6 * skill.GetLevel());
}
public int GetExecutetime(Skill skill)
{
return 700;
}
public int GetCoolingtime(Skill skill)
{
return 8000;
}
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 0f;
}
public float GetAttackdistance(Skill skill)
{
return 0f;
}
public float GetAngle(Skill skill)
{
return (float)(1 - 0.0111111 * 0);
}
public float GetPraydistance(Skill skill)
{
return (float)skill.GetPlayer().GetRange();
}
#if SKILL_CLIENT
public int GetIntroduction(Skill skill, StringBuilder buffer, int length, string format)
{
string result = string.Format(format,
skill.GetLevel(),
-2.2 + 5.6 * skill.GetLevel(),
5.9 * skill.GetLevel() * skill.GetLevel() + 126.7 * skill.GetLevel() + 40.5);
if (result.Length < length)
{
buffer.Append(result);
return result.Length;
}
return 0;
}
#endif
#if SKILL_SERVER
public int GetEnmity(Skill skill)
{
return 0;
}
public bool StateAttack(Skill skill)
{
skill.GetVictim().SetProbability(1.0f * 100);
skill.GetVictim().SetTime(15000);
skill.GetVictim().SetAmount(5.9f * skill.GetLevel() * skill.GetLevel() + 126.7f * skill.GetLevel() + 40.5f);
skill.GetVictim().SetBleeding(1);
return true;
}
public bool TakeEffect(Skill skill)
{
return true;
}
public float GetEffectdistance(Skill skill)
{
return 11.7f;
}
public int GetAttackspeed(Skill skill)
{
return 3;
}
public float GetHitrate(Skill skill)
{
return (float)(1.2 + 0.05 * skill.GetLevel());
}
#endif
}
}