+25
-19
@@ -54,7 +54,8 @@ func Api(ctx *gin.Context) {
|
|||||||
|
|
||||||
switch v.Module {
|
switch v.Module {
|
||||||
case "login":
|
case "login":
|
||||||
if v.Action == "topInfo" {
|
switch v.Action {
|
||||||
|
case "topInfo":
|
||||||
// key = "login_topinfo_result"
|
// key = "login_topinfo_result"
|
||||||
topInfoResp := model.TopInfoResp{
|
topInfoResp := model.TopInfoResp{
|
||||||
Result: model.TopInfoRes{
|
Result: model.TopInfoRes{
|
||||||
@@ -91,7 +92,7 @@ func Api(ctx *gin.Context) {
|
|||||||
}
|
}
|
||||||
res, err = json.Marshal(topInfoResp)
|
res, err = json.Marshal(topInfoResp)
|
||||||
utils.CheckErr(err)
|
utils.CheckErr(err)
|
||||||
} else if v.Action == "topInfoOnce" {
|
case "topInfoOnce":
|
||||||
// key = "login_topinfo_once_result"
|
// key = "login_topinfo_once_result"
|
||||||
topInfoOnceResp := model.TopInfoOnceResp{
|
topInfoOnceResp := model.TopInfoOnceResp{
|
||||||
Result: model.TopInfoOnceRes{
|
Result: model.TopInfoOnceRes{
|
||||||
@@ -125,7 +126,8 @@ func Api(ctx *gin.Context) {
|
|||||||
utils.CheckErr(err)
|
utils.CheckErr(err)
|
||||||
}
|
}
|
||||||
case "live":
|
case "live":
|
||||||
if v.Action == "liveStatus" {
|
switch v.Action {
|
||||||
|
case "liveStatus":
|
||||||
// key = "live_status_result"
|
// key = "live_status_result"
|
||||||
var liveDifficultyId []int
|
var liveDifficultyId []int
|
||||||
normalLives := []model.NormalLiveStatusList{}
|
normalLives := []model.NormalLiveStatusList{}
|
||||||
@@ -173,7 +175,7 @@ func Api(ctx *gin.Context) {
|
|||||||
}
|
}
|
||||||
res, err = json.Marshal(LiveStatusResp)
|
res, err = json.Marshal(LiveStatusResp)
|
||||||
utils.CheckErr(err)
|
utils.CheckErr(err)
|
||||||
} else if v.Action == "schedule" {
|
case "schedule":
|
||||||
// key = "live_list_result"
|
// key = "live_list_result"
|
||||||
var liveDifficultyId []int
|
var liveDifficultyId []int
|
||||||
specialLives := []model.SpecialLiveStatusList{}
|
specialLives := []model.SpecialLiveStatusList{}
|
||||||
@@ -216,7 +218,7 @@ func Api(ctx *gin.Context) {
|
|||||||
}
|
}
|
||||||
res, err = json.Marshal(liveListResp)
|
res, err = json.Marshal(liveListResp)
|
||||||
utils.CheckErr(err)
|
utils.CheckErr(err)
|
||||||
} else {
|
default:
|
||||||
fmt.Println("Invalid action: ", v.Module, v.Action)
|
fmt.Println("Invalid action: ", v.Module, v.Action)
|
||||||
}
|
}
|
||||||
case "unit":
|
case "unit":
|
||||||
@@ -419,16 +421,17 @@ func Api(ctx *gin.Context) {
|
|||||||
albumList.UnitID = unit.UnitId
|
albumList.UnitID = unit.UnitId
|
||||||
if unit.Rarity != 4 {
|
if unit.Rarity != 4 {
|
||||||
albumList.SignFlag = false
|
albumList.SignFlag = false
|
||||||
if unit.Rarity == 1 {
|
switch unit.Rarity {
|
||||||
|
case 1:
|
||||||
albumList.HighestLovePerUnit = 50
|
albumList.HighestLovePerUnit = 50
|
||||||
albumList.TotalLove = 50
|
albumList.TotalLove = 50
|
||||||
} else if unit.Rarity == 2 {
|
case 2:
|
||||||
albumList.HighestLovePerUnit = 200
|
albumList.HighestLovePerUnit = 200
|
||||||
albumList.TotalLove = 200
|
albumList.TotalLove = 200
|
||||||
} else if unit.Rarity == 3 {
|
case 3:
|
||||||
albumList.HighestLovePerUnit = 500
|
albumList.HighestLovePerUnit = 500
|
||||||
albumList.TotalLove = 500
|
albumList.TotalLove = 500
|
||||||
} else if unit.Rarity == 5 {
|
case 5:
|
||||||
albumList.HighestLovePerUnit = 750
|
albumList.HighestLovePerUnit = 750
|
||||||
albumList.TotalLove = 750
|
albumList.TotalLove = 750
|
||||||
}
|
}
|
||||||
@@ -541,11 +544,12 @@ func Api(ctx *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// HACK event_scenario_btn_asset
|
// HACK event_scenario_btn_asset
|
||||||
if id == 10001 {
|
switch id {
|
||||||
|
case 10001:
|
||||||
eventList.EventScenarioBtnAsset = "assets/image/ui/eventscenario/38_se_ba_t.png"
|
eventList.EventScenarioBtnAsset = "assets/image/ui/eventscenario/38_se_ba_t.png"
|
||||||
} else if id == 221 {
|
case 221:
|
||||||
eventList.EventScenarioBtnAsset = "assets/image/ui/eventscenario/215_se_ba_t.png"
|
eventList.EventScenarioBtnAsset = "assets/image/ui/eventscenario/215_se_ba_t.png"
|
||||||
} else {
|
default:
|
||||||
eventList.EventScenarioBtnAsset = fmt.Sprintf("assets/image/ui/eventscenario/%d_se_ba_t.png", id)
|
eventList.EventScenarioBtnAsset = fmt.Sprintf("assets/image/ui/eventscenario/%d_se_ba_t.png", id)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -726,7 +730,8 @@ func Api(ctx *gin.Context) {
|
|||||||
fmt.Println("Invalid action: ", v.Module, v.Action)
|
fmt.Println("Invalid action: ", v.Module, v.Action)
|
||||||
}
|
}
|
||||||
case "user":
|
case "user":
|
||||||
if v.Action == "getNavi" {
|
switch v.Action {
|
||||||
|
case "getNavi":
|
||||||
// key = "user_intro_result"
|
// key = "user_intro_result"
|
||||||
var uId, oId int
|
var uId, oId int
|
||||||
_, err := UserEng.Table("user_preference_m").Where("user_id = ?", ctx.GetString("userid")).Cols("user_id,unit_owning_user_id").Get(&uId, &oId)
|
_, err := UserEng.Table("user_preference_m").Where("user_id = ?", ctx.GetString("userid")).Cols("user_id,unit_owning_user_id").Get(&uId, &oId)
|
||||||
@@ -744,7 +749,7 @@ func Api(ctx *gin.Context) {
|
|||||||
}
|
}
|
||||||
res, err = json.Marshal(userIntroResp)
|
res, err = json.Marshal(userIntroResp)
|
||||||
utils.CheckErr(err)
|
utils.CheckErr(err)
|
||||||
} else if v.Action == "userInfo" {
|
case "userInfo":
|
||||||
userId, err := strconv.Atoi(ctx.GetString("userid"))
|
userId, err := strconv.Atoi(ctx.GetString("userid"))
|
||||||
utils.CheckErr(err)
|
utils.CheckErr(err)
|
||||||
|
|
||||||
@@ -793,7 +798,7 @@ func Api(ctx *gin.Context) {
|
|||||||
}
|
}
|
||||||
res, err = json.Marshal(userInfoResp)
|
res, err = json.Marshal(userInfoResp)
|
||||||
utils.CheckErr(err)
|
utils.CheckErr(err)
|
||||||
} else {
|
default:
|
||||||
fmt.Println("Invalid action: ", v.Module, v.Action)
|
fmt.Println("Invalid action: ", v.Module, v.Action)
|
||||||
}
|
}
|
||||||
case "navigation":
|
case "navigation":
|
||||||
@@ -1030,7 +1035,8 @@ func Api(ctx *gin.Context) {
|
|||||||
fmt.Println("Invalid action: ", v.Module, v.Action)
|
fmt.Println("Invalid action: ", v.Module, v.Action)
|
||||||
}
|
}
|
||||||
case "profile":
|
case "profile":
|
||||||
if v.Action == "liveCnt" {
|
switch v.Action {
|
||||||
|
case "liveCnt":
|
||||||
// key = "profile_livecnt_result"
|
// key = "profile_livecnt_result"
|
||||||
difficultyResp := model.DifficultyResp{
|
difficultyResp := model.DifficultyResp{
|
||||||
Result: []model.DifficultyRes{
|
Result: []model.DifficultyRes{
|
||||||
@@ -1061,7 +1067,7 @@ func Api(ctx *gin.Context) {
|
|||||||
}
|
}
|
||||||
res, err = json.Marshal(difficultyResp)
|
res, err = json.Marshal(difficultyResp)
|
||||||
utils.CheckErr(err)
|
utils.CheckErr(err)
|
||||||
} else if v.Action == "cardRanking" {
|
case "cardRanking":
|
||||||
// key = "profile_card_ranking_result"
|
// key = "profile_card_ranking_result"
|
||||||
var result []any
|
var result []any
|
||||||
love := honokautils.ReadAllText("assets/serverdata/love.json")
|
love := honokautils.ReadAllText("assets/serverdata/love.json")
|
||||||
@@ -1075,7 +1081,7 @@ func Api(ctx *gin.Context) {
|
|||||||
}
|
}
|
||||||
res, err = json.Marshal(loveResp)
|
res, err = json.Marshal(loveResp)
|
||||||
utils.CheckErr(err)
|
utils.CheckErr(err)
|
||||||
} else if v.Action == "profileInfo" {
|
case "profileInfo":
|
||||||
// key = "profile_info_result"
|
// key = "profile_info_result"
|
||||||
pref := tools.UserPref{}
|
pref := tools.UserPref{}
|
||||||
exists, err := UserEng.Table("user_preference_m").Where("user_id = ?", ctx.GetString("userid")).Get(&pref)
|
exists, err := UserEng.Table("user_preference_m").Where("user_id = ?", ctx.GetString("userid")).Get(&pref)
|
||||||
@@ -1236,7 +1242,7 @@ func Api(ctx *gin.Context) {
|
|||||||
}
|
}
|
||||||
res, err = json.Marshal(profileResp)
|
res, err = json.Marshal(profileResp)
|
||||||
utils.CheckErr(err)
|
utils.CheckErr(err)
|
||||||
} else {
|
default:
|
||||||
fmt.Println("Invalid action: ", v.Module, v.Action)
|
fmt.Println("Invalid action: ", v.Module, v.Action)
|
||||||
}
|
}
|
||||||
case "secretbox":
|
case "secretbox":
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ func LBonusExecute(ctx *gin.Context) {
|
|||||||
Amount: 1,
|
Amount: 1,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
if c == d2 {
|
if c.Equal(d2) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -86,7 +86,7 @@ func LBonusExecute(ctx *gin.Context) {
|
|||||||
Amount: 1,
|
Amount: 1,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
if c == d2 {
|
if c.Equal(d2) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+28
-21
@@ -161,11 +161,12 @@ func PlayLive(ctx *gin.Context) {
|
|||||||
// fmt.Println("回忆画廊属性加成后的基础属性:", baseSmile, basePure, baseCool)
|
// fmt.Println("回忆画廊属性加成后的基础属性:", baseSmile, basePure, baseCool)
|
||||||
|
|
||||||
// 绊属性加成(该加成会影响个宝等百分比宝石属性加成的计算,故先计算。)
|
// 绊属性加成(该加成会影响个宝等百分比宝石属性加成的计算,故先计算。)
|
||||||
if attrId == 1 {
|
switch attrId {
|
||||||
|
case 1:
|
||||||
baseSmile += maxLove
|
baseSmile += maxLove
|
||||||
} else if attrId == 2 {
|
case 2:
|
||||||
basePure += maxLove
|
basePure += maxLove
|
||||||
} else if attrId == 3 {
|
case 3:
|
||||||
baseCool += maxLove
|
baseCool += maxLove
|
||||||
}
|
}
|
||||||
// fmt.Println("绊属性加成:", maxLove)
|
// fmt.Println("绊属性加成:", maxLove)
|
||||||
@@ -194,11 +195,12 @@ func PlayLive(ctx *gin.Context) {
|
|||||||
|
|
||||||
if fixedValueFlag == 1 {
|
if fixedValueFlag == 1 {
|
||||||
// 吻、眼神属性加成(固定数值)
|
// 吻、眼神属性加成(固定数值)
|
||||||
if effectType == 1 {
|
switch effectType {
|
||||||
|
case 1:
|
||||||
kissSmile += effectValue
|
kissSmile += effectValue
|
||||||
} else if effectType == 2 {
|
case 2:
|
||||||
kissPure += effectValue
|
kissPure += effectValue
|
||||||
} else if effectType == 3 {
|
case 3:
|
||||||
kissCool += effectValue
|
kissCool += effectValue
|
||||||
}
|
}
|
||||||
// fmt.Println("吻、眼神属性加成:", kissSmile, kissPure, kissCool)
|
// fmt.Println("吻、眼神属性加成:", kissSmile, kissPure, kissCool)
|
||||||
@@ -207,11 +209,12 @@ func PlayLive(ctx *gin.Context) {
|
|||||||
if effectType == 1 || effectType == 2 || effectType == 3 {
|
if effectType == 1 || effectType == 2 || effectType == 3 {
|
||||||
// 加成范围:2:全员 1:非全员
|
// 加成范围:2:全员 1:非全员
|
||||||
if effectRange == 2 {
|
if effectRange == 2 {
|
||||||
if effectType == 1 {
|
switch effectType {
|
||||||
|
case 1:
|
||||||
skillSmile += math.Ceil(baseSmile * (effectValue / 100))
|
skillSmile += math.Ceil(baseSmile * (effectValue / 100))
|
||||||
} else if effectType == 2 {
|
case 2:
|
||||||
skillPure += math.Ceil(basePure * (effectValue / 100))
|
skillPure += math.Ceil(basePure * (effectValue / 100))
|
||||||
} else if effectType == 3 {
|
case 3:
|
||||||
skillCool += math.Ceil(baseCool * (effectValue / 100))
|
skillCool += math.Ceil(baseCool * (effectValue / 100))
|
||||||
}
|
}
|
||||||
// fmt.Println("全员类宝石属性加成:", skillSmile, skillPure, skillCool)
|
// fmt.Println("全员类宝石属性加成:", skillSmile, skillPure, skillCool)
|
||||||
@@ -255,11 +258,12 @@ func PlayLive(ctx *gin.Context) {
|
|||||||
Cols("unit_m.attribute_id,unit_leader_skill_m.effect_value").Get(&myAttrId, &myEffectValue)
|
Cols("unit_m.attribute_id,unit_leader_skill_m.effect_value").Get(&myAttrId, &myEffectValue)
|
||||||
utils.CheckErr(err)
|
utils.CheckErr(err)
|
||||||
var myCenterSmile, myCenterPure, myCenterCool float64
|
var myCenterSmile, myCenterPure, myCenterCool float64
|
||||||
if myAttrId == 1 {
|
switch myAttrId {
|
||||||
|
case 1:
|
||||||
myCenterSmile = math.Ceil(smileMax * (myEffectValue / 100))
|
myCenterSmile = math.Ceil(smileMax * (myEffectValue / 100))
|
||||||
} else if myAttrId == 2 {
|
case 2:
|
||||||
myCenterPure = math.Ceil(pureMax * (myEffectValue / 100))
|
myCenterPure = math.Ceil(pureMax * (myEffectValue / 100))
|
||||||
} else if myAttrId == 3 {
|
case 3:
|
||||||
myCenterCool = math.Ceil(coolMax * (myEffectValue / 100))
|
myCenterCool = math.Ceil(coolMax * (myEffectValue / 100))
|
||||||
}
|
}
|
||||||
// fmt.Println("主C技能属性加成:", myCenterSmile, myCenterPure, myCenterCool)
|
// fmt.Println("主C技能属性加成:", myCenterSmile, myCenterPure, myCenterCool)
|
||||||
@@ -278,11 +282,12 @@ func PlayLive(ctx *gin.Context) {
|
|||||||
utils.CheckErr(err)
|
utils.CheckErr(err)
|
||||||
var mySubSmile, mySubPure, mySubCool float64
|
var mySubSmile, mySubPure, mySubCool float64
|
||||||
if exists {
|
if exists {
|
||||||
if myAttrId == 1 {
|
switch myAttrId {
|
||||||
|
case 1:
|
||||||
mySubSmile = math.Ceil(smileMax * (mySubEffectValue / 100))
|
mySubSmile = math.Ceil(smileMax * (mySubEffectValue / 100))
|
||||||
} else if myAttrId == 2 {
|
case 2:
|
||||||
mySubPure = math.Ceil(pureMax * (mySubEffectValue / 100))
|
mySubPure = math.Ceil(pureMax * (mySubEffectValue / 100))
|
||||||
} else if myAttrId == 3 {
|
case 3:
|
||||||
mySubCool = math.Ceil(coolMax * (mySubEffectValue / 100))
|
mySubCool = math.Ceil(coolMax * (mySubEffectValue / 100))
|
||||||
}
|
}
|
||||||
// fmt.Println("副C技能属性加成:", mySubSmile, mySubPure, mySubCool)
|
// fmt.Println("副C技能属性加成:", mySubSmile, mySubPure, mySubCool)
|
||||||
@@ -310,11 +315,12 @@ func PlayLive(ctx *gin.Context) {
|
|||||||
Cols("unit_m.attribute_id,unit_leader_skill_m.effect_value").Get(&tomoAttrId, &tomoEffectValue)
|
Cols("unit_m.attribute_id,unit_leader_skill_m.effect_value").Get(&tomoAttrId, &tomoEffectValue)
|
||||||
utils.CheckErr(err)
|
utils.CheckErr(err)
|
||||||
var tomoCenterSmile, tomoCenterPure, tomoCenterCool float64
|
var tomoCenterSmile, tomoCenterPure, tomoCenterCool float64
|
||||||
if myAttrId == 1 {
|
switch myAttrId {
|
||||||
|
case 1:
|
||||||
tomoCenterSmile = math.Ceil(smileMax * (tomoEffectValue / 100))
|
tomoCenterSmile = math.Ceil(smileMax * (tomoEffectValue / 100))
|
||||||
} else if myAttrId == 2 {
|
case 2:
|
||||||
tomoCenterPure = math.Ceil(pureMax * (tomoEffectValue / 100))
|
tomoCenterPure = math.Ceil(pureMax * (tomoEffectValue / 100))
|
||||||
} else if myAttrId == 3 {
|
case 3:
|
||||||
tomoCenterCool = math.Ceil(coolMax * (tomoEffectValue / 100))
|
tomoCenterCool = math.Ceil(coolMax * (tomoEffectValue / 100))
|
||||||
}
|
}
|
||||||
// fmt.Println("好友主C技能属性加成:", tomoCenterSmile, tomoCenterPure, tomoCenterCool)
|
// fmt.Println("好友主C技能属性加成:", tomoCenterSmile, tomoCenterPure, tomoCenterCool)
|
||||||
@@ -333,11 +339,12 @@ func PlayLive(ctx *gin.Context) {
|
|||||||
utils.CheckErr(err)
|
utils.CheckErr(err)
|
||||||
var tomoSubSmile, tomoSubPure, tomoSubCool float64
|
var tomoSubSmile, tomoSubPure, tomoSubCool float64
|
||||||
if exists {
|
if exists {
|
||||||
if myAttrId == 1 {
|
switch myAttrId {
|
||||||
|
case 1:
|
||||||
tomoSubSmile = math.Ceil(smileMax * (tomoSubEffectValue / 100))
|
tomoSubSmile = math.Ceil(smileMax * (tomoSubEffectValue / 100))
|
||||||
} else if myAttrId == 2 {
|
case 2:
|
||||||
tomoSubPure = math.Ceil(pureMax * (tomoSubEffectValue / 100))
|
tomoSubPure = math.Ceil(pureMax * (tomoSubEffectValue / 100))
|
||||||
} else if myAttrId == 3 {
|
case 3:
|
||||||
tomoSubCool = math.Ceil(coolMax * (tomoSubEffectValue / 100))
|
tomoSubCool = math.Ceil(coolMax * (tomoSubEffectValue / 100))
|
||||||
}
|
}
|
||||||
// fmt.Println("好友副C技能属性加成:", tomoSubSmile, tomoSubPure, tomoSubCool)
|
// fmt.Println("好友副C技能属性加成:", tomoSubSmile, tomoSubPure, tomoSubCool)
|
||||||
|
|||||||
Reference in New Issue
Block a user