本文整理汇总了C#中BaseGame类的典型用法代码示例。如果您正苦于以下问题:C# BaseGame类的具体用法?C# BaseGame怎么用?C# BaseGame使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BaseGame类属于命名空间,在下文中一共展示了BaseGame类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleCommand
public void HandleCommand(BaseGame game, Player player, GSPacketIn packet)
{
if (player.IsAttacking)
{
player.Skip(packet.ReadByte());
}
}
示例2: HandleCommand
public void HandleCommand(BaseGame game, Player player, GSPacketIn packet)
{
if(game is PVEGame)
{
PVEGame pve = game as PVEGame;
int tryAgain = packet.ReadInt();
bool isHost = packet.ReadBoolean();
if (isHost == true)
{
if (tryAgain == 1)
{
if (player.PlayerDetail.RemoveMoney(100) > 0)
{
//退回关卡结算
pve.WantTryAgain = 1;
game.SendToAll(packet);
player.PlayerDetail.LogAddMoney(AddMoneyType.Game, AddMoneyType.Game_TryAgain, player.PlayerDetail.PlayerCharacter.ID, 100, player.PlayerDetail.PlayerCharacter.Money);
}
else
{
player.PlayerDetail.SendInsufficientMoney((int)eBattleRemoveMoneyType.TryAgain);
}
}
else
{
//退回房间
pve.WantTryAgain = 0;
game.SendToAll(packet);
}
pve.CheckState(0);
}
}
}
示例3: ExecuteImp
protected override void ExecuteImp(BaseGame game, long tick)
{
if (!m_isSent)
{
m_isSent = true;
game.SendLivingFall(m_living, m_toX, m_toY, m_fallSpeed, m_action, m_type);
}
if (m_toY > m_living.Y + m_fallSpeed)
{
m_living.SetXY(m_toX, m_living.Y + m_fallSpeed);
}
else
{
m_living.SetXY(m_toX, m_toY);
if (game.Map.IsOutMap(m_toX, m_toY))
{
m_living.SyncAtTime = false;
m_living.Die();
Console.WriteLine("掉落Fall" + m_living.IsLiving.ToString());
}
if (m_callback != null)
{
//m_living.RunLuaFunction(m_callback);
m_living.CallFuction(m_callback, 0);
}
Finish(tick);
}
}
示例4: ExecuteImp
protected override void ExecuteImp(BaseGame game, long tick)
{
if (!m_isSent)
{
m_isSent = true;
game.SendLivingMoveTo(m_living, m_living.X, m_living.Y, m_path[m_path.Count - 1].X, m_path[m_path.Count - 1].Y, m_action, m_speed);
}
m_index++;
if (m_index >= m_path.Count)
{
if (m_path[m_index - 1].X > m_living.X)
{
m_living.Direction = 1;
}
else
{
m_living.Direction = -1;
}
m_living.SetXY(m_path[m_index - 1].X, m_path[m_index - 1].Y);
if (m_callback != null)
{
m_living.CallFuction(m_callback, 0);
}
Finish(tick);
}
}
示例5: ExecuteImp
protected override void ExecuteImp(BaseGame game, long tick)
{
m_obj.CurrentAction = m_action;
game.SendPhysicalObjPlayAction(m_obj);
Finish(tick);
}
示例6: SimpleNpc
public SimpleNpc(int id, BaseGame game, NpcInfo npcInfo, int type)
: base(id, game, npcInfo.Camp, npcInfo.Name, npcInfo.ModelID, npcInfo.Blood, npcInfo.Immunity, -1)
{
if (type == 0)
{
Type = eLivingType.SimpleNpc;
}
else
{
Type = eLivingType.SimpleNpc1;
}
m_npcInfo = npcInfo;
m_ai = ScriptMgr.CreateInstance(npcInfo.Script) as ABrain;
if (m_ai == null)
{
log.ErrorFormat("Can't create abrain :{0}", npcInfo.Script);
m_ai = SimpleBrain.Simple;
}
m_ai.Game = m_game;
m_ai.Body = this;
try
{
m_ai.OnCreated();
}
catch (Exception ex)
{
log.ErrorFormat("SimpleNpc Created error:{1}", ex);
}
}
示例7: Execute
public void Execute(BaseGame game, Player player, ItemTemplateInfo item)
{
if (player.IsLiving)
{
new SealEffect(item.Property3, 1).Start(player);
}
}
示例8: Label
public Label(Control parent, BaseGame game)
: base(parent, game)
{
Text = string.Empty;
Font = new Font(this);
}
示例9: ExecuteImp
protected override void ExecuteImp(BaseGame game, long tick)
{
GSPacketIn pkg = new GSPacketIn((byte)ePackageType.GAME_CMD, m_living.Id);
pkg.Parameter1 = m_living.Id;
pkg.WriteByte((byte)eTankCmdType.LIVING_RANGEATTACKING);
List<Living> playersAround = game.Map.FindPlayers(m_fx, m_tx, m_players);
int count = playersAround.Count;
foreach (Living p in playersAround)
{
if (m_living.IsFriendly(p) == true)
count--;
}
pkg.WriteInt(count);
m_living.SyncAtTime = false;
try
{
foreach (Living p in playersAround)
{
p.SyncAtTime = false;
if (m_living.IsFriendly(p) == true)
continue;
int dander = 0;
p.IsFrost = false;
game.SendGameUpdateFrozenState(p);
int damage = MakeDamage(p);
int critical = MakeCriticalDamage(p, damage);
int totalDemageAmount = 0;
if (p.TakeDamage(m_living, ref damage, ref critical, "范围攻击"))
{
totalDemageAmount = damage + critical;
if (p is Player)
{
Player player = p as Player;
dander = player.Dander;
}
}
pkg.WriteInt(p.Id);
pkg.WriteInt(totalDemageAmount);
pkg.WriteInt(p.Blood);
//同步怒气值
pkg.WriteInt(dander);
//attackEffect
pkg.WriteInt(new Random().Next(2));
}
game.SendToAll(pkg);
Finish(tick);
}
finally
{
m_living.SyncAtTime = true;
foreach (Living p in playersAround)
{
p.SyncAtTime = true;
}
}
}
示例10: HandleCommand
public void HandleCommand(BaseGame game, Player player, GSPacketIn packet)
{
if (game.GameState != eGameState.Playing || player.GetSealState())
return;
int type = packet.ReadByte();
int place = packet.ReadInt();
int templateID = packet.ReadInt();
ItemTemplateInfo template = ItemMgr.FindItemTemplate(templateID);
if (player.CanUseItem(template))
{
//if (player.CurrentBall.ID == 3 && template.TemplateID == 10003)
// return;
//if (player.PlayerDetail.UsePropItem(game, type, place, templateID, player.IsLiving))
//{
// if (player.UseItem(template) == false)
// {
// BaseGame.log.Error("Using prop error");
// }
//}
if (player.PlayerDetail.UsePropItem(game, type, place, templateID, player.IsLiving))
{
if (player.UseItem(template) == false)
{
BaseGame.log.Error("Using prop error");
}
}
else
{
player.UseItem(template);
}
}
}
示例11: Execute
public void Execute(BaseGame game, Player player, ItemTemplateInfo item)
{
switch (item.Property2)
{
case 0:
if (player.IsLiving)
{
player.AddBlood(item.Property3);
}
break;
case 1:
List<Player> temps = player.Game.GetAllFightPlayers();
foreach (Player p in temps)
{
if (p.IsLiving && p.Team == player.Team)
{
p.AddBlood(item.Property3);
}
}
break;
default:
break;
}
}
示例12: Player
public Player(IGamePlayer player, int id, BaseGame game, int team)
: base(id, game, team, "", "", 1000, 0, 1) //TODO lastPatemer direction
{
m_rect = new Rectangle(-15, -20, 30, 30);
m_player = player;
m_player.GamePlayerId = id;
m_isActive = true;
m_canGetProp = true;
Grade = player.PlayerCharacter.Grade;
TotalAllHurt = 0;
TotalAllHitTargetCount = 0;
TotalAllShootCount = 0;
TotalAllKill = 0;
TotalAllExperience = 0;
TotalAllScore = 0;
TotalAllCure = 0;
m_weapon = m_player.MainWeapon;
if (m_weapon != null)
{
var ballConfig = BallConfigMgr.FindBall(m_weapon.TemplateID);
m_mainBallId = ballConfig.Common;
m_spBallId = ballConfig.Special;
//m_mainBallId = m_weapon.Property1;
//m_spBallId = m_weapon.Property2;
}
m_loadingProcess = 0;
InitBuffer(m_player.EquipEffect);
m_energy = (m_player.PlayerCharacter.Agility / 30 + 240);
m_maxBlood = (int)((950 + m_player.PlayerCharacter.Grade * 50 + LevelPlusBlood + m_player.PlayerCharacter.Defence / 10) * m_player.GetBaseBlood());
}
示例13: HandleCommand
public void HandleCommand(BaseGame game, Player player, GSPacketIn packet)
{
if (game is PVEGame)
{
PVEGame pve = game as PVEGame;
if (pve.BossCardCount + 1 > 0)
{
int index = packet.ReadByte();
if (index < 0 || index > pve.BossCards.Length)
{
if (pve.IsBossWar != "")
{
pve.TakeBossCard(player);
}
else pve.TakeCard(player);
}
else
{
if (pve.IsBossWar != "")
{
pve.TakeBossCard(player, index);
}
else pve.TakeCard(player, index);
}
}
}
}
示例14: HandleCommand
public void HandleCommand(BaseGame game, Player player, GSPacketIn packet)
{
if (player.IsAttacking)
{
player.UseSpecialSkill();
}
}
示例15: Window
public Window(Control parent, BaseGame game)
: base(parent, game)
{
_backColor = Color.Black;
BackColor = Color.Transparent;
ForeColor = Color.White;
}