Compare commits
2 Commits
db82eabb7c
...
ae4ab17075
Author | SHA1 | Date |
---|---|---|
|
ae4ab17075 | |
|
2c8ce6a467 |
|
@ -33,7 +33,7 @@ func (this *PlayerEx) CanOp(sceneEx *SceneEx) bool {
|
||||||
|
|
||||||
func (this *PlayerEx) CanPayCoin() bool {
|
func (this *PlayerEx) CanPayCoin() bool {
|
||||||
|
|
||||||
return false
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
// 游戏新一局 设置数据
|
// 游戏新一局 设置数据
|
||||||
|
|
|
@ -445,9 +445,29 @@ func (this *StateStart) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, pa
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sceneEx, ok := s.ExtraData.(*SceneEx)
|
||||||
|
if !ok {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
playerEx, ok := p.ExtraData.(*PlayerEx)
|
||||||
|
if !ok {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
switch opcode {
|
switch opcode {
|
||||||
case rule.ClawDollPlayerOpPayCoin:
|
case rule.ClawDollPlayerOpPayCoin:
|
||||||
|
if !playerEx.CanPayCoin() {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
// 1-前 2-后 3-左 4-右 5-投币
|
||||||
|
pack := &machine.SMDollMachineoPerate{
|
||||||
|
Snid: proto.Int32(p.SnId),
|
||||||
|
Id: proto.Int32(int32(sceneEx.machineId)),
|
||||||
|
Perate: proto.Int32(int32(5)),
|
||||||
|
}
|
||||||
|
|
||||||
|
sceneEx.SendToMachine(int(machine.DollMachinePacketID_PACKET_SMDollMachinePerate), pack)
|
||||||
}
|
}
|
||||||
|
|
||||||
return false
|
return false
|
||||||
|
@ -524,14 +544,23 @@ func (this *PlayGame) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, para
|
||||||
if !playerEx.CanPayCoin() {
|
if !playerEx.CanPayCoin() {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
sceneEx.OnPlayerSCOp(p, opcode, clawdoll.OpResultCode_OPRC_Success, params)
|
|
||||||
|
|
||||||
|
// 1-前 2-后 3-左 4-右 5-投币
|
||||||
|
pack := &machine.SMDollMachineoPerate{
|
||||||
|
Snid: proto.Int32(p.SnId),
|
||||||
|
Id: proto.Int32(int32(sceneEx.machineId)),
|
||||||
|
Perate: proto.Int32(int32(5)),
|
||||||
|
}
|
||||||
|
|
||||||
|
sceneEx.SendToMachine(int(machine.DollMachinePacketID_PACKET_SMDollMachinePerate), pack)
|
||||||
|
|
||||||
|
//sceneEx.OnPlayerSCOp(p, opcode, clawdoll.OpResultCode_OPRC_Success, params)
|
||||||
case rule.ClawDollPlayerOpGo:
|
case rule.ClawDollPlayerOpGo:
|
||||||
|
|
||||||
pack := &machine.SMDollMachineGrab{
|
pack := &machine.SMDollMachineGrab{
|
||||||
Snid: proto.Int32(p.SnId),
|
Snid: proto.Int32(p.SnId),
|
||||||
Id: proto.Int32(int32(sceneEx.machineId)),
|
Id: proto.Int32(int32(sceneEx.machineId)),
|
||||||
TypeId: proto.Int32(int32(1)),
|
TypeId: proto.Int32(int32(2)),
|
||||||
}
|
}
|
||||||
|
|
||||||
sceneEx.SendToMachine(int(machine.DollMachinePacketID_PACKET_SMDollMachineGrab), pack)
|
sceneEx.SendToMachine(int(machine.DollMachinePacketID_PACKET_SMDollMachineGrab), pack)
|
||||||
|
|
Loading…
Reference in New Issue