Skip to content

Commit ab76a6a

Browse files
committed
Adding a skill use event, disabling auto-tag workflow
1 parent c2ff8db commit ab76a6a

24 files changed

+125
-26
lines changed

.github/workflows/auto-tag.yml

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
1-
name: Auto Tag
1+
#name: Auto Tag
22

3-
on:
4-
push:
5-
branches:
6-
- master
7-
- '**'
3+
#on:
4+
# push:
5+
# branches:
6+
# - master
7+
# - '**'
88

9-
permissions:
10-
contents: write
9+
#permissions:
10+
# contents: write
1111

12-
jobs:
13-
tag:
14-
runs-on: ubuntu-latest
15-
steps:
16-
- uses: actions/checkout@v4
17-
with:
18-
fetch-depth: 0 # Needed to access all tags
19-
20-
- name: Create tag using commit message
21-
id: tagger
22-
uses: mathieudutour/[email protected]
23-
with:
24-
tag_prefix: 'v'
25-
default_bump: 'patch'
26-
default_prerelease_bump: 'prerelease'
27-
dry_run: false # Set to false for actual tagging in production
28-
github_token: ${{ secrets.GITHUB_TOKEN }}
12+
#jobs:
13+
# tag:
14+
# runs-on: ubuntu-latest
15+
# steps:
16+
# - uses: actions/checkout@v4
17+
# with:
18+
# fetch-depth: 0 # Needed to access all tags
2919

20+
# - name: Create tag using commit message
21+
# id: tagger
22+
# uses: mathieudutour/[email protected]
23+
# with:
24+
# tag_prefix: 'v'
25+
# default_bump: 'patch'
26+
# default_prerelease_bump: 'prerelease'
27+
# dry_run: false # Set to false for actual tagging in production
28+
# github_token: ${{ secrets.GITHUB_TOKEN }}

internal/events/eventtypes.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66

77
"github.com/GoMudEngine/GoMud/internal/connections"
88
"github.com/GoMudEngine/GoMud/internal/items"
9+
"github.com/GoMudEngine/GoMud/internal/skills"
910
"github.com/GoMudEngine/GoMud/internal/stats"
1011
)
1112

@@ -65,6 +66,15 @@ type Input struct {
6566

6667
func (i Input) Type() string { return `Input` }
6768

69+
// When a skill is used by a player
70+
type SkillUsed struct {
71+
UserId int
72+
Skill skills.SkillTag
73+
Details string // usually the specific sub-command of the skill
74+
}
75+
76+
func (i SkillUsed) Type() string { return `SkillUsed` }
77+
6878
// Messages that are intended to reach all users on the system
6979
type Broadcast struct {
7080
Text string

internal/usercommands/appraise.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func Appraise(rest string, user *users.UserRecord, room *rooms.Room, flags event
4545
}
4646

4747
details := inspectDetails{
48-
InspectLevel: 2,
48+
InspectLevel: 3,
4949
Item: &item,
5050
ItemSpec: &itemSpec,
5151
}

internal/usercommands/skill.brawling.disarm.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ func Disarm(rest string, user *users.UserRecord, room *rooms.Room, flags events.
4040
}
4141
}
4242

43+
// Fire an event that a skill has been used
44+
events.AddToQueue(events.SkillUsed{user.UserId, skills.Brawling, `disarm`})
45+
4346
if attackMobInstanceId > 0 {
4447

4548
m := mobs.GetInstance(attackMobInstanceId)

internal/usercommands/skill.brawling.recover.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ func Recover(rest string, user *users.UserRecord, room *rooms.Room, flags events
3434
return true, nil
3535
}
3636

37+
// Fire an event that a skill has been used
38+
events.AddToQueue(events.SkillUsed{user.UserId, skills.Brawling, `recover`})
39+
3740
user.AddBuff(23, `skill`) // Warriors respite
3841

3942
return true, nil

internal/usercommands/skill.brawling.tackle.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ func Tackle(rest string, user *users.UserRecord, room *rooms.Room, flags events.
3434
return true, nil
3535
}
3636

37+
// Fire an event that a skill has been used
38+
events.AddToQueue(events.SkillUsed{user.UserId, skills.Brawling, `tackle`})
39+
3740
attackMobInstanceId := user.Character.Aggro.MobInstanceId
3841
attackPlayerId := user.Character.Aggro.UserId
3942

internal/usercommands/skill.brawling.throw.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ func Throw(rest string, user *users.UserRecord, room *rooms.Room, flags events.E
5353
return true, nil
5454
}
5555

56+
// Fire an event that a skill has been used
57+
events.AddToQueue(events.SkillUsed{user.UserId, skills.Brawling, `throw`})
58+
5659
targetPlayerId, targetMobId := room.FindByName(throwWhere)
5760

5861
if targetMobId > 0 {

internal/usercommands/skill.cast.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,10 @@ func Cast(rest string, user *users.UserRecord, room *rooms.Room, flags events.Ev
281281
}
282282

283283
if continueCasting {
284+
285+
// Fire an event that a skill has been used
286+
events.AddToQueue(events.SkillUsed{user.UserId, skills.Cast, spellInfo.SpellId})
287+
284288
user.Character.Mana -= spellInfo.Cost
285289
events.AddToQueue(events.CharacterVitalsChanged{UserId: user.UserId})
286290
user.Character.SetCast(spellInfo.WaitRounds, spellAggro)

internal/usercommands/skill.enchant.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ func Enchant(rest string, user *users.UserRecord, room *rooms.Room, flags events
9595
return true, nil
9696
}
9797

98+
// Fire an event that a skill has been used
99+
events.AddToQueue(events.SkillUsed{user.UserId, skills.Enchant, `uncurse`})
100+
98101
user.Character.RemoveItem(matchItem)
99102
matchItem.Uncurse()
100103
user.Character.StoreItem(matchItem)
@@ -118,6 +121,9 @@ func Enchant(rest string, user *users.UserRecord, room *rooms.Room, flags events
118121
return true, nil
119122
}
120123

124+
// Fire an event that a skill has been used
125+
events.AddToQueue(events.SkillUsed{user.UserId, skills.Enchant, `remove`})
126+
121127
room.SendText(
122128
fmt.Sprintf(`<ansi fg="username">%s</ansi> holds out their <ansi fg="itemname">%s</ansi> and slowly waves their hand over it. Runes appear to glow on the surface, which fade as they float away.`, user.Character.Name, matchItem.DisplayName()),
123129
user.UserId,
@@ -161,6 +167,9 @@ func Enchant(rest string, user *users.UserRecord, room *rooms.Room, flags events
161167
return true, errors.New(`you're doing that too often`)
162168
}
163169

170+
// Fire an event that a skill has been used
171+
events.AddToQueue(events.SkillUsed{user.UserId, skills.Enchant, ``})
172+
164173
damageBonus := 0
165174
defenseBonus := 0
166175
statBonus := map[string]int{}

internal/usercommands/skill.inspect.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ func Inspect(rest string, user *users.UserRecord, room *rooms.Room, flags events
4747
return true, errors.New(`you're doing that too often`)
4848
}
4949

50+
// Fire an event that a skill has been used
51+
events.AddToQueue(events.SkillUsed{user.UserId, skills.Inspect, ``})
52+
5053
user.SendText(
5154
fmt.Sprintf(`You inspect the <ansi fg="item">%s</ansi>.`, matchItem.DisplayName()),
5255
)

0 commit comments

Comments
 (0)