Skip to content

Commit

Permalink
validation of skill fix, money boost
Browse files Browse the repository at this point in the history
  • Loading branch information
tivvit committed Oct 12, 2023
1 parent a908724 commit bccd81b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion server/dungeonsandtrolls/game.go
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ func (g *Game) GetPlayerByKey(apiKey string) (*gameobject.Player, error) {
}

func (g *Game) GetMoney() int32 {
return int32(math.Pow(float64(g.Score)*0.001, 0.75) + float64(420))
return int32(math.Pow(float64(g.Score)*0.004, 0.75) + float64(420))
}

func (g *Game) SpawnPlayer(p *gameobject.Player, level int32) {
Expand Down
6 changes: 3 additions & 3 deletions server/dungeonsandtrolls/handlers/skill.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ func validateSkill(game *dungeonsandtrolls.Game, skillUse *api.SkillUse, p gameo
if (skillUse.TargetId != nil || skillUse.Position != nil) && (s.Target == api.Skill_none) {
return fmt.Errorf("skill target should be none")
}
if skillUse.Position == nil && s.Target == api.Skill_position {
return fmt.Errorf("skill location not specified")
}

if s.Flags != nil {
if s.Flags.Passive {
Expand Down Expand Up @@ -122,9 +125,6 @@ func validateSkill(game *dungeonsandtrolls.Game, skillUse *api.SkillUse, p gameo
}
}
if skillUse.Position != nil {
if skillUse.Position == nil && s.Target == api.Skill_position {
return fmt.Errorf("skill location not specified")
}
l, err := game.GetCachedLevel(p.GetPosition().Level)
if err != nil {
return fmt.Errorf("level not found")
Expand Down

0 comments on commit bccd81b

Please sign in to comment.