赛跑活动

This commit is contained in:
hahwu 2025-04-02 16:22:23 +08:00
parent 4ddde1b2e9
commit 56d3b6d53a
3 changed files with 12 additions and 2 deletions

View File

@ -55,7 +55,7 @@ func ActivityLogin(p *Player) {
}
// 赛跑
ActivityId = GetActivityId(p, ACT_TYPE_GUESS_COLOR)
ActivityId = GetActivityId(p, ACT_TYPE_RACE)
RaceMod := p.PlayMod.getRaceMod()
OldId = RaceMod.Login(ActivityId)
if OldId != 0 {
@ -84,6 +84,11 @@ func ActivityZeroUpdate(p *Player) {
GuessColorMod := p.PlayMod.getGuessColorMod()
GuessColorMod.ZeroUpdate(ActivityInfo.Id)
}
ActivityInfo = GetActivityInfo(p, ACT_TYPE_RACE)
if ActivityInfo != nil {
RaceMod := p.PlayMod.getRaceMod()
RaceMod.ZeroUpdate(ActivityInfo.Id)
}
}
func GetActivityInfo(p *Player, actType int) *ActivityInfo {

View File

@ -227,6 +227,11 @@ func ReqGmCommand_(player *Player, Command string) error {
RaceMod.ZeroUpdate(-1)
ActivityInfo := GetActivityInfo(player, ACT_TYPE_RACE)
RaceMod.ZeroUpdate(ActivityInfo.Id)
RaceBackData(player)
case "raceAdd":
RaceMod := player.PlayMod.getRaceMod()
RaceMod.AddCoin(100)
RaceBackData(player)
case "playroomTrigger":
PlayroomOrderTrigger(player)
case "playroomReset":

View File

@ -90,7 +90,7 @@ func (r *RaceMod) GetReward() ([]*item.Item, error) {
Items = append(Items, ExtraReward...)
}
r.Pass++
r.Progress -= Need
r.Progress = 0
MaxPass := raceCfg.GetMaxPass(r.Id)
if r.Pass > MaxPass {
r.Pass = 1