fix(fight): 修复战斗效果类型初始化错误 - 将EffectType.NewSel更改为EffectType.Skill以修正技能效果类型 - 移除effect_415中的多余变量声明,直接使用参数值进行治疗计算 feat(admin): 添加用户金币增加功能 - 新增UserGoldAddReq结构体用于处理金币添加请求 - 实现GoldAdd方法支持管理员为指定用户增加金币 feat(pet):
This commit is contained in:
@@ -27,5 +27,5 @@ func (e *Effect197) SwitchOut(in *input.Input) bool {
|
||||
return true
|
||||
}
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 197, &Effect197{})
|
||||
input.InitEffect(input.EffectType.Skill, 197, &Effect197{})
|
||||
}
|
||||
|
||||
@@ -25,5 +25,5 @@ func (e *Effect199) SwitchOut(in *input.Input) bool {
|
||||
return true
|
||||
}
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 199, &Effect199{})
|
||||
input.InitEffect(input.EffectType.Skill, 199, &Effect199{})
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ func (e *Effect9) SkillHit() bool {
|
||||
return true
|
||||
}
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 484, &Effect484{})
|
||||
input.InitEffect(input.EffectType.Skill, 484, &Effect484{})
|
||||
}
|
||||
|
||||
// 484 - 连击n次,每次命中后连击数+m,最高连击p次
|
||||
@@ -84,7 +84,7 @@ type Effect411 struct {
|
||||
}
|
||||
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 411, &Effect411{})
|
||||
input.InitEffect(input.EffectType.Skill, 411, &Effect411{})
|
||||
}
|
||||
func (e *Effect411) Skill_Use() bool {
|
||||
|
||||
@@ -99,10 +99,10 @@ func (e *Effect411) Skill_Use() bool {
|
||||
}
|
||||
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 497, &Effect429{
|
||||
input.InitEffect(input.EffectType.Skill, 497, &Effect429{
|
||||
ispower: true,
|
||||
})
|
||||
input.InitEffect(input.EffectType.NewSel, 497, &Effect429{})
|
||||
input.InitEffect(input.EffectType.Skill, 497, &Effect429{})
|
||||
}
|
||||
|
||||
// 497 - 附加m点固定伤害,每次使用额外附加n点,最高k点,遇到天敌时效果翻倍
|
||||
@@ -129,7 +129,7 @@ func (e *Effect429) Skill_Use() bool {
|
||||
}
|
||||
func init() {
|
||||
|
||||
input.InitEffect(input.EffectType.NewSel, 181, &Effect181{})
|
||||
input.InitEffect(input.EffectType.Skill, 181, &Effect181{})
|
||||
}
|
||||
|
||||
// 181 - n%几率令对手XX,连续攻击每次提高m%几率最高提高k%
|
||||
|
||||
@@ -23,5 +23,5 @@ func (e *Effect509) OnSkill() bool {
|
||||
return true
|
||||
}
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 509, &Effect509{})
|
||||
input.InitEffect(input.EffectType.Skill, 509, &Effect509{})
|
||||
}
|
||||
|
||||
@@ -39,5 +39,5 @@ func (e *Effect163) SetArgs(t *input.Input, a ...int) {
|
||||
e.EffectNode.Duration(a[0]) // 持续n回合
|
||||
}
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 163, &Effect163{})
|
||||
input.InitEffect(input.EffectType.Skill, 163, &Effect163{})
|
||||
}
|
||||
|
||||
@@ -35,5 +35,5 @@ func (e *Effect174) SetArgs(t *input.Input, a ...int) {
|
||||
e.EffectNode.Duration(a[0]) // 持续n回合
|
||||
}
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 174, &Effect174{})
|
||||
input.InitEffect(input.EffectType.Skill, 174, &Effect174{})
|
||||
}
|
||||
|
||||
@@ -29,5 +29,5 @@ func (e *Effect187) SetArgs(t *input.Input, a ...int) {
|
||||
}
|
||||
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 187, &Effect187{})
|
||||
input.InitEffect(input.EffectType.Skill, 187, &Effect187{})
|
||||
}
|
||||
|
||||
@@ -25,5 +25,5 @@ func (e *Effect189) SetArgs(t *input.Input, a ...int) {
|
||||
e.EffectNode.Duration(a[0]) // 持续n回合
|
||||
}
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 189, &Effect189{})
|
||||
input.InitEffect(input.EffectType.Skill, 189, &Effect189{})
|
||||
}
|
||||
|
||||
@@ -32,5 +32,5 @@ func (e *Effect192) OnSkill() bool {
|
||||
}
|
||||
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 192, &Effect192{})
|
||||
input.InitEffect(input.EffectType.Skill, 192, &Effect192{})
|
||||
}
|
||||
|
||||
@@ -15,14 +15,13 @@ type Effect415 struct {
|
||||
|
||||
func (e *Effect415) Skill_Use() bool {
|
||||
damageThreshold := int(e.Args()[0].IntPart())
|
||||
healAmount := e.Args()[1].IntPart()
|
||||
|
||||
if e.Ctx().Our.SumDamage.Cmp(alpacadecimal.NewFromInt(int64(damageThreshold))) > 0 {
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, alpacadecimal.NewFromInt(int64(healAmount)))
|
||||
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Args()[1])
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 415, &Effect415{})
|
||||
input.InitEffect(input.EffectType.Skill, 415, &Effect415{})
|
||||
}
|
||||
|
||||
@@ -22,5 +22,5 @@ func (e *Effect447) DamageLockEx(t *info.DamageZone) bool {
|
||||
return true
|
||||
}
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 447, &Effect447{})
|
||||
input.InitEffect(input.EffectType.Skill, 447, &Effect447{})
|
||||
}
|
||||
|
||||
@@ -26,5 +26,5 @@ func (e *Effect452) SetArgs(t *input.Input, a ...int) {
|
||||
}
|
||||
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 452, &Effect452{})
|
||||
input.InitEffect(input.EffectType.Skill, 452, &Effect452{})
|
||||
}
|
||||
|
||||
@@ -35,5 +35,5 @@ func (e *Effect455) Skill_Use_ex() bool {
|
||||
return true
|
||||
}
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 455, &Effect455{})
|
||||
input.InitEffect(input.EffectType.Skill, 455, &Effect455{})
|
||||
}
|
||||
|
||||
@@ -27,5 +27,5 @@ func (e *Effect459) OnSkill() bool {
|
||||
return true
|
||||
}
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 459, &Effect459{})
|
||||
input.InitEffect(input.EffectType.Skill, 459, &Effect459{})
|
||||
}
|
||||
|
||||
@@ -48,5 +48,5 @@ func (e *Effect479) OnSkill() bool {
|
||||
return true
|
||||
}
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 479, &Effect479{})
|
||||
input.InitEffect(input.EffectType.Skill, 479, &Effect479{})
|
||||
}
|
||||
|
||||
@@ -22,5 +22,5 @@ func (e *Effect482) ActionStartEx(fattack, sattack *action.SelectSkillAction) bo
|
||||
return true
|
||||
}
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 482, &Effect482{})
|
||||
input.InitEffect(input.EffectType.Skill, 482, &Effect482{})
|
||||
}
|
||||
|
||||
@@ -23,5 +23,5 @@ func (e *Effect487) OnSkill() bool {
|
||||
return true
|
||||
}
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 487, &Effect487{})
|
||||
input.InitEffect(input.EffectType.Skill, 487, &Effect487{})
|
||||
}
|
||||
|
||||
@@ -36,5 +36,5 @@ func (e *Effect502) SetArgs(t *input.Input, a ...int) {
|
||||
e.EffectNode.Duration(a[0]) // 持续n回合
|
||||
}
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 502, &Effect502{})
|
||||
input.InitEffect(input.EffectType.Skill, 502, &Effect502{})
|
||||
}
|
||||
|
||||
@@ -19,5 +19,5 @@ func (e *Effect510) Skill_Use_ex() bool {
|
||||
return true
|
||||
}
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 510, &Effect510{})
|
||||
input.InitEffect(input.EffectType.Skill, 510, &Effect510{})
|
||||
}
|
||||
|
||||
@@ -32,5 +32,5 @@ func (e *Effect514) OnSkill() bool {
|
||||
return true
|
||||
}
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 514, &Effect514{})
|
||||
input.InitEffect(input.EffectType.Skill, 514, &Effect514{})
|
||||
}
|
||||
|
||||
@@ -34,5 +34,5 @@ func (e *Effect515) OnSkill() bool {
|
||||
return true
|
||||
}
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 515, &Effect515{})
|
||||
input.InitEffect(input.EffectType.Skill, 515, &Effect515{})
|
||||
}
|
||||
|
||||
@@ -35,5 +35,5 @@ func (e *Effect517) OnSkill() bool {
|
||||
}
|
||||
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 452, &Effect517{})
|
||||
input.InitEffect(input.EffectType.Skill, 452, &Effect517{})
|
||||
}
|
||||
|
||||
@@ -25,5 +25,5 @@ func (e *Effect520) Skill_Use() bool {
|
||||
}
|
||||
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 520, &Effect520{})
|
||||
input.InitEffect(input.EffectType.Skill, 520, &Effect520{})
|
||||
}
|
||||
|
||||
@@ -27,5 +27,5 @@ func (e *Effect545) SetArgs(t *input.Input, a ...int) {
|
||||
e.EffectNode.Duration(a[0]) // 持续n回合
|
||||
}
|
||||
func init() {
|
||||
input.InitEffect(input.EffectType.NewSel, 545, &Effect545{})
|
||||
input.InitEffect(input.EffectType.Skill, 545, &Effect545{})
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ func (c *BaseSysUserController) GetSession(ctx context.Context, req *SessionReq)
|
||||
if playerinfo != nil {
|
||||
res.IsReg = 1
|
||||
if t1.DepartmentID == 35 { ///抢先服玩家,3天没登录衰退
|
||||
|
||||
|
||||
if playerinfo.UpdateTime.AddDate(0, 0, 3).Before(gtime.Now()) {
|
||||
t1.DepartmentID = 1
|
||||
service.NewBaseSysUserService().SetdepartmentId(uint32(t1.ID), 1)
|
||||
@@ -137,3 +137,17 @@ func (c *BaseSysUserController) Regrobot(ctx context.Context, req *RegReq) (res
|
||||
type RegRes struct {
|
||||
Session string `json:"session"`
|
||||
}
|
||||
|
||||
type UserGoldAddReq struct {
|
||||
g.Meta `path:"/goldadd" method:"GET"`
|
||||
Authorization string `json:"Authorization" in:"header"`
|
||||
|
||||
UserID int `json:"userid"`
|
||||
Gold float32 `json:"gold"`
|
||||
}
|
||||
|
||||
func (c *BaseSysUserController) GoldAdd(ctx context.Context, req *UserGoldAddReq) (res *cool.BaseRes, err error) {
|
||||
service.NewBaseSysUserService().UpdateGold(uint32(req.UserID), int64(req.Gold*100))
|
||||
res = cool.Ok(nil)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -28,6 +28,8 @@ type Pet struct {
|
||||
PlayerID uint32 `gorm:"not null;index:idx_pet_by_player_id;comment:'所属玩家ID'" json:"player_id"`
|
||||
Free int `gorm:"not null;default:0;comment:'是否放生'" json:"free"` //"0为放入仓库,1为放入背包
|
||||
CatchTime uint32 `gorm:"not null;comment:'捕捉时间'" json:"catch_time"` //唯一键
|
||||
IsSale int `gorm:"not null;default:0;comment:'是否出售'" json:"is_sale"`
|
||||
SalePrice int `gorm:"not null;default:0;comment:'出售价格'" json:"sale_price"`
|
||||
// Owner uint32 `struc:"skip"` //仅作为存储
|
||||
// FreedTime uint32 `struc:"skip"` //放生时间
|
||||
//是否可交易,这里应该定义在精灵ID里
|
||||
|
||||
@@ -174,16 +174,10 @@ func NewPetService(userid uint32) *PetService {
|
||||
admin = cool.GetAdmin(ctx)
|
||||
userId = admin.UserId
|
||||
)
|
||||
if userId != 10001 {
|
||||
return [][]interface{}{
|
||||
{"player_id", userId, true},
|
||||
{"free", 1, true},
|
||||
}
|
||||
} else {
|
||||
return [][]interface{}{
|
||||
// {"player_id", userId, true},
|
||||
// {"free", 1, true},
|
||||
}
|
||||
return [][]interface{}{
|
||||
{"player_id", userId, true},
|
||||
{"free", 1, true},
|
||||
{"is_vip", 0, true},
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user