209 lines
4.6 KiB
C#
209 lines
4.6 KiB
C#
using System.Runtime.InteropServices;
|
|
using UnityEngine;
|
|
|
|
namespace BrewMonster
|
|
{
|
|
|
|
public class PlayerInfo { }
|
|
|
|
public struct ComboArg
|
|
{
|
|
public const int MAX_COMBO_ARG = 3;
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_COMBO_ARG)]
|
|
public int[] arg;
|
|
|
|
public int GetValue(uint index)
|
|
{
|
|
if (arg == null)
|
|
arg = new int[MAX_COMBO_ARG];
|
|
return index < MAX_COMBO_ARG ? arg[index] : 0;
|
|
}
|
|
|
|
public void SetValue(uint index, int value)
|
|
{
|
|
if (arg == null)
|
|
arg = new int[MAX_COMBO_ARG];
|
|
if (index < MAX_COMBO_ARG)
|
|
arg[index] = value;
|
|
}
|
|
}
|
|
|
|
public class PlayerWrapper
|
|
{
|
|
|
|
public float range;
|
|
public float pray_range_plus;
|
|
public int elf_level;
|
|
public ComboArg comboarg;
|
|
|
|
private PlayerInfo object_;
|
|
|
|
public PlayerWrapper()
|
|
{
|
|
range = 0;
|
|
pray_range_plus = 0;
|
|
elf_level = 0;
|
|
comboarg = new ComboArg { arg = new int[ComboArg.MAX_COMBO_ARG] };
|
|
}
|
|
|
|
public PlayerWrapper(PlayerInfo o)
|
|
{
|
|
range = 0;
|
|
pray_range_plus = 0;
|
|
elf_level = 0;
|
|
object_ = o;
|
|
comboarg = new ComboArg { arg = new int[ComboArg.MAX_COMBO_ARG] };
|
|
}
|
|
|
|
public int GetLevel() { return 50; }
|
|
|
|
public void SetRange(float r) { range = r; }
|
|
|
|
public void SetPrayrangeplus(float p) { pray_range_plus = p; }
|
|
|
|
public int GetMP()
|
|
{
|
|
return 10000;
|
|
}
|
|
|
|
public int GetMp()
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
public int GetSp()
|
|
{
|
|
return 10000;
|
|
}
|
|
|
|
public bool IsRiding()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
public bool IsUsingWeapon(int weapon)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public bool HasSkillBook(uint id)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public bool SetDecsp(int sp)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public bool SetDistance(float d)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public float GetWeapondistance()
|
|
{
|
|
return -1;
|
|
}
|
|
|
|
public bool SetDecmp(int m)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public bool SetPray(bool value)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public bool SetInform(bool value)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public bool SetPerform(bool value)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public bool SetDamage(int value)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public int GetPerform()
|
|
{
|
|
return 1;
|
|
}
|
|
|
|
public int GetDamage()
|
|
{
|
|
return 1;
|
|
}
|
|
|
|
public float GetRange()
|
|
{
|
|
return range;
|
|
}
|
|
|
|
public float GetPrayrangeplus()
|
|
{
|
|
return pray_range_plus;
|
|
}
|
|
|
|
public bool SetCheckbook(int i) { return true; }
|
|
|
|
public int GetCheckbook() { return 0; }
|
|
|
|
public bool SetCheckmoney(int m) { return true; }
|
|
|
|
public int GetCheckmoney() { return 0; }
|
|
|
|
public bool SetUsebook(int i) { return true; }
|
|
|
|
public int GetUsebook() { return 0; }
|
|
|
|
public bool SetUsemoney(int m) { return true; }
|
|
|
|
public int GetUsemoney() { return 0; }
|
|
|
|
public void SetElflevel(int iLevel) { elf_level = iLevel; }
|
|
|
|
public int GetElflevel() { return elf_level; }
|
|
|
|
public ref ComboArg GetComboarg() { return ref comboarg; }
|
|
|
|
public int GetForm() { return 0; }
|
|
|
|
// Respond to some events of automatic policy behavior
|
|
public void AP_ActionEvent(int iEvent, int iParam)
|
|
{
|
|
// if (!CECAutoPolicy.GetInstance().IsAutoPolicyEnabled())
|
|
// return;
|
|
|
|
// Cannot convert: CECAutoPolicy class does not exist
|
|
// PlayerWrapper pWrapper = CECAutoPolicy.GetInstance().GetPlayerWrapper();
|
|
// if (pWrapper != null)
|
|
// pWrapper.OnActionEvent(iEvent, iParam);
|
|
|
|
#if _SHOW_AUTOPOLICY_DEBUG
|
|
// Cannot convert: a_LogOutput function does not exist
|
|
// Debug.LogFormat("AP_ActionEvent: {0}, Param = {1}", AP_GetEventName(iEvent), iParam);
|
|
// g_pGame.RuntimeDebugInfo(0xff0000ff, string.Format("AP_ActionEvent: {0}, Param = {1}", EVENT_NAME[iEvent], iParam));
|
|
#endif
|
|
}
|
|
}
|
|
|
|
public class TargetWrapper
|
|
{
|
|
public int id;
|
|
|
|
public TargetWrapper(int i)
|
|
{
|
|
id = i;
|
|
}
|
|
|
|
public bool IsValid() { return -1 != id; }
|
|
}
|
|
}
|