本文整理汇总了C#中BaseGame类的典型用法代码示例。如果您正苦于以下问题:C# BaseGame类的具体用法?C# BaseGame怎么用?C# BaseGame使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BaseGame类属于命名空间,在下文中一共展示了BaseGame类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: HandleCommand
public void HandleCommand(BaseGame game, Player player, GSPacketIn packet)
{
if (player.IsAttacking)
{
player.Skip(packet.ReadByte());
}
}
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:7,代码来源:SkipNextCommand.cs
示例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);
}
}
}
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:33,代码来源:TryAgainCommand.cs
示例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);
}
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:29,代码来源:LivingFallingAction.cs
示例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);
}
}
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:28,代码来源:LivingMoveToAction.cs
示例5: ExecuteImp
protected override void ExecuteImp(BaseGame game, long tick)
{
m_obj.CurrentAction = m_action;
game.SendPhysicalObjPlayAction(m_obj);
Finish(tick);
}
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:7,代码来源:PhysicalObjDoAction.cs
示例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);
}
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:32,代码来源:SimpleNpc.cs
示例7: Execute
public void Execute(BaseGame game, Player player, ItemTemplateInfo item)
{
if (player.IsLiving)
{
new SealEffect(item.Property3, 1).Start(player);
}
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:7,代码来源:SealSpell.cs
示例8: Label
public Label(Control parent, BaseGame game)
: base(parent, game)
{
Text = string.Empty;
Font = new Font(this);
}
开发者ID:deccer,项目名称:ValhallaClone,代码行数:7,代码来源:Label.cs
示例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;
}
}
}
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:60,代码来源:LivingRangeAttackingAction.cs
示例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);
}
}
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:35,代码来源:PropUseCommand.cs
示例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;
}
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:25,代码来源:AddLifeSpell.cs
示例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());
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:32,代码来源:Player.cs
示例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);
}
}
}
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:27,代码来源:BossTakeCardCommand.cs
示例14: HandleCommand
public void HandleCommand(BaseGame game, Player player, GSPacketIn packet)
{
if (player.IsAttacking)
{
player.UseSpecialSkill();
}
}
开发者ID:vancourt,项目名称:BaseGunnyII,代码行数:7,代码来源:StuntCommand.cs
示例15: Window
public Window(Control parent, BaseGame game)
: base(parent, game)
{
_backColor = Color.Black;
BackColor = Color.Transparent;
ForeColor = Color.White;
}
开发者ID:deccer,项目名称:ValhallaClone,代码行数:7,代码来源:Window.cs
示例16: Execute
public void Execute(BaseGame game, long tick)
{
if(m_tick <= tick && m_finishTick == long.MaxValue)
{
ExecuteImp(game, tick);
}
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:7,代码来源:BaseAction.cs
示例17: HandleCommand
public void HandleCommand(BaseGame game, Player player, GSPacketIn packet)
{
if (player.HasPaymentTakeCard == false)
{
if (player.PlayerDetail.RemoveMoney(100) > 0&&player.PlayerDetail.RemoveGiftToken(429)>0)
{
int index = packet.ReadByte();
player.CanTakeOut += 1;
player.FinishTakeCard = false;
player.HasPaymentTakeCard = true;
player.PlayerDetail.LogAddMoney(AddMoneyType.Game, AddMoneyType.Game_PaymentTakeCard, player.PlayerDetail.PlayerCharacter.ID, 100, player.PlayerDetail.PlayerCharacter.Money);
if (index < 0 || index > game.Cards.Length)
{
game.TakeCard(player);
}
else
{
game.TakeCard(player, index);
}
}
else
{
player.PlayerDetail.SendInsufficientMoney((int)eBattleRemoveMoneyType.PaymentTakeCard);
}
}
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:27,代码来源:PaymentTakeCardCommand.cs
示例18: PlayerScreen
public PlayerScreen(Control parent, BaseGame game)
: base(parent, game)
{
Name = "scnPlayer";
_game = game;
//InitializeComponents();
}
开发者ID:deccer,项目名称:ValhallaClone,代码行数:8,代码来源:PlayerScreen.cs
示例19: FPSCounter
public FPSCounter(BaseGame setGame, string fontName)
: base(setGame)
{
font = setGame.Content.Load<SpriteFont>(fontName);
int W = setGame.GraphicsDevice.Viewport.Width;
int H = setGame.GraphicsDevice.Viewport.Height;
fps = new StringToDraw(setGame, "FPS=", new Vector2((W - 100.0f) / (float)W, 5.0f / (float)H), font);
}
开发者ID:AnupGupta,项目名称:geometry-wars-clone,代码行数:8,代码来源:FPSCounter.cs
示例20: HandleCommand
public void HandleCommand(BaseGame game, Player player, GSPacketIn packet)
{
if (player.IsLiving == false)
{
player.TargetPoint.X = packet.ReadInt();
player.TargetPoint.Y = packet.ReadInt();
}
}
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:8,代码来源:SetGhostTargetCommand.cs
注:本文中的BaseGame类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论