36 lines
954 B
Go
36 lines
954 B
Go
package game
|
|
|
|
// 补偿脚本
|
|
import (
|
|
"server/game/mod/compensation"
|
|
"server/game/mod/mail"
|
|
)
|
|
|
|
func (p *Player) Compensation() {
|
|
p.Compensation20250910()
|
|
}
|
|
|
|
func (p *Player) Compensation20250910() {
|
|
compensationMod := p.PlayMod.getCompensationMod()
|
|
if compensationMod.Is20250910() {
|
|
return // 已经领取过补偿
|
|
}
|
|
PlayerBaseMod := p.GetPlayerBaseMod()
|
|
items := compensationMod.Compensation20250910(PlayerBaseMod.GetName())
|
|
if len(items) == 0 {
|
|
return // 没有补偿物品
|
|
}
|
|
MailMod := p.PlayMod.getMailMod()
|
|
MailMod.SendMail(&mail.MailStruct{
|
|
Title: compensation.Compensation20250910_Mail_Config.Title,
|
|
SubTitle: "",
|
|
Content: compensation.Compensation20250910_Mail_Config.Content,
|
|
TitleEn: compensation.Compensation20250910_Mail_Config.Title,
|
|
SubTitleEn: "",
|
|
ContentEn: compensation.Compensation20250910_Mail_Config.Content,
|
|
Items: items,
|
|
Type: mail.MAIL_TYPE_NORMAL,
|
|
})
|
|
p.PlayMod.save()
|
|
}
|