diff options
| author | historia <[not public]> | 2026-06-24 20:58:25 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-06-24 20:58:25 -0400 |
| commit | 9d4b799db4868bcab291b83599ff088763cd4ed6 (patch) | |
| tree | 252f0fcc779acf35243983d643d6399ee2e0cd0b /internal/player | |
| parent | d25638d98fe63efdeab570ef77e6a6a97f2d7a60 (diff) | |
| download | thehouseoficarus-9d4b799db4868bcab291b83599ff088763cd4ed6.tar.gz | |
feat: new type of non-violent 'combat': work
Diffstat (limited to 'internal/player')
| -rw-r--r-- | internal/player/player.go | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/internal/player/player.go b/internal/player/player.go index ebba376..03ed7ac 100644 --- a/internal/player/player.go +++ b/internal/player/player.go @@ -10,7 +10,7 @@ import ( type SkillName string const ( - Attack SkillName = "attack" + Accuracy SkillName = "accuracy" Strength SkillName = "strength" Defense SkillName = "defense" Hitpoints SkillName = "hitpoints" @@ -36,13 +36,13 @@ const ( ) var AllSkills = []SkillName{ - Attack, Strength, Defense, Hitpoints, Ranged, Science, Technology, + Accuracy, Strength, Defense, Hitpoints, Ranged, Science, Technology, Fishing, Cooking, Woodcutting, Firemaking, Mining, Smithing, Crafting, Fletching, Pharmacy, Thieving, Agility, Construction, Scavenging, Hacking, Assassin, Farming, } var SkillAbbr = map[SkillName]string{ - Attack: "atk", + Accuracy: "acc", Strength: "str", Defense: "def", Hitpoints: "hp", @@ -139,6 +139,7 @@ var OptionDefs = []OptionDef{ {"construct_all", OptBool, false, nil, "Auto-start constructing when only one product is possible"}, {"craft_all", OptBool, false, nil, "Auto-start crafting when only one product is possible"}, {"safespot_alert", OptString, "{196 bold}** Your safespot has been compromised! **{/}", nil, "Message shown when forced out of a safespot"}, + {"danger_warning", OptBool, true, nil, "Confirm before entering a dangerous (hazardous) area"}, } var optionByName map[string]*OptionDef @@ -169,6 +170,7 @@ type Player struct { Prompt string `yaml:"prompt"` Options map[string]any `yaml:"-"` Flags map[string]any `yaml:"flags"` + CutsceneRoom int `yaml:"cutscene_room,omitempty"` RegenerateTick int AmmoQty int `yaml:"ammo_qty,omitempty"` Action *action.Action `yaml:"-"` @@ -180,10 +182,14 @@ type Player struct { MoveTicks int `yaml:"-"` MoveDirection string `yaml:"-"` MoveTarget int `yaml:"-"` + MovePendingFlags map[string]any `yaml:"-"` + MovePendingPlayerFlags map[string]any `yaml:"-"` VisualTickCurrent int `yaml:"-"` AutotriggerMod string `yaml:"-"` QueuedTrigger string `yaml:"-"` AttackTimer int `yaml:"-"` + HazardTimer int `yaml:"-"` + PendingDangerDir string `yaml:"-"` Battery float64 `yaml:"battery"` ActiveTechs map[string]bool `yaml:"-"` QuickTech string `yaml:"quick_tech,omitempty"` @@ -210,6 +216,8 @@ func (p *Player) ClearMoveState() { p.MoveTicks = 0 p.MoveDirection = "" p.MoveTarget = 0 + p.MovePendingFlags = nil + p.MovePendingPlayerFlags = nil } func (p *Player) OptionBool(name string) bool { @@ -358,7 +366,7 @@ func (p *Player) AddSkillXP(s SkillName, amount int) int { func (p *Player) CombatLevel() int { base := 0.25 * float64(p.Level(Defense)+p.Level(Hitpoints)+p.Level(Technology)) - att := float64(p.Level(Attack)) + att := float64(p.Level(Accuracy)) str := float64(p.Level(Strength)) if float64(p.Level(Ranged))*1.5 > att+str { |
