Skip to content

Commit

Permalink
add CS+ Steam and KAGE commands
Browse files Browse the repository at this point in the history
  • Loading branch information
jozsefsallai committed Jan 20, 2022
1 parent 9aa329b commit 823fdd7
Show file tree
Hide file tree
Showing 6 changed files with 211 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.13
go-version: ^1.16
id: go

- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
go-version: 1.16

- name: Import PGP key
run: echo -e "${{ secrets.PGP_SIGNING_KEY }}" | gpg --import
Expand Down
99 changes: 99 additions & 0 deletions config/.tscrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,33 @@
},

"tsc": {
"<2MV": {
"label": "<2MV",
"detail": "2nd player MoVe",
"documentation": "Move the other player next to the player who had executed the command (Switch).",
"format": "<2MV",
"insertText": "<2MV"
},
"<2PJ": {
"label": "<2PJ",
"detail": "2-Player Jump",
"documentation": "Jump to event X if in multiplayer mode (Switch).",
"format": "<2MVXXXX",
"insertText": "2PJ${1:0000}",
"argtype": [
"number"
]
},
"<ACH": {
"label": "<ACH",
"detail": "ACHievement",
"documentation": "Trigger Steam achievement X. No-op in the EGS/Humble Bundle version of the game.",
"format": "<ACHXXXX",
"insertText": "ACH${1:0000}",
"argtype": [
"number"
]
},
"<AE+": {
"label": "<AE+",
"detail": "Arms Energy +",
Expand Down Expand Up @@ -271,6 +298,17 @@
"direction"
]
},
"<FF-": {
"label": "<FF-",
"detail": "First Flag - (false)",
"documentation": "Set first flag in range X-Y to false (Switch).",
"format": "<FF-XXXX:YYYY",
"insertText": "FF-${1:0000}:${2:0000}",
"argtype": [
"number",
"number"
]
},
"<FL+": {
"label": "<FL+",
"detail": "FLag +",
Expand Down Expand Up @@ -348,6 +386,13 @@
"number"
]
},
"<FR2": {
"label": "<FR2",
"detail": "FRee 2",
"documentation": "Free game action and PCs (Switch multiplayer).",
"format": "<FR2",
"insertText": "FR2"
},
"<FRE": {
"label": "<FRE",
"detail": "FREe",
Expand All @@ -365,6 +410,13 @@
"item"
]
},
"<HM2": {
"label": "<HM2",
"detail": "Hide My character 2",
"documentation": "Hide the player who executed the event (Switch).",
"format": "<HM2",
"insertText": "HM2"
},
"<HMC": {
"label": "<HMC",
"detail": "Hide My Character",
Expand All @@ -379,6 +431,18 @@
"format": "<INI",
"insertText": "INI"
},
"<INJ": {
"label": "<INJ",
"detail": "Item Number Jump",
"documentation": "Jump to event Z if amount of item X equals Y (Switch).",
"format": "<INJXXXX:YYYY:ZZZZ",
"insertText": "INJ${1:0000}:${2:0000}:${3:0000}",
"argtype": [
"item",
"number",
"number"
]
},
"<INP": {
"label": "<INP",
"detail": "[Initialize?] NPc",
Expand Down Expand Up @@ -422,6 +486,24 @@
"number"
]
},
"<I+N": {
"label": "<I+N",
"detail": "Item + N",
"documentation": "Adds item X with maximum amount of Y (Switch).",
"format": "<I+NXXXX:YYYY",
"insertText": "I+N${1:0000}:${2:0000}",
"argtype": [
"item",
"number"
]
},
"<KE2": {
"label": "<KE2",
"detail": "KEY lock for multiplayer",
"documentation": "Lock player controls and hide status bars until <END (Switch multiplayer).",
"format": "<KE2",
"insertText": "KE2"
},
"<KEY": {
"label": "<KEY",
"detail": "KEY lock",
Expand Down Expand Up @@ -590,13 +672,30 @@
"number"
]
},
"<POP": {
"label": "<POP",
"detail": "POP text script state",
"documentation": "Restore text script state from stack and resume previous event (Switch).",
"format": "<POP",
"insertText": "POP"
},
"<PRI": {
"label": "<PRI",
"detail": "PRevent Interaction",
"documentation": "Lock player controls and freeze game action until KEY or END.",
"format": "<PRI",
"insertText": "PRI"
},
"<PSH": {
"label": "<PSH",
"detail": "PuSH text script state",
"documentation": "Push the current script state onto the stack and start event X (Switch).",
"format": "<PSHXXXX",
"insertText": "PSH${1:0000}",
"argtype": [
"number"
]
},
"<PS+": {
"label": "<PS+",
"detail": "Portal Slot +",
Expand Down
20 changes: 10 additions & 10 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ func TestNew(t *testing.T) {
t.Run("should return the default configuration", func(t *testing.T) {
config := New()

// default config has 91 TSC command definitions
if len(config.TSC) != 91 {
t.Errorf("config.New(): got %v, want %v", len(config.TSC), 91)
// default config has 102 TSC command definitions
if len(config.TSC) != 102 {
t.Errorf("config.New(): got %v, want %v", len(config.TSC), 102)
}
})
}
Expand Down Expand Up @@ -45,13 +45,13 @@ func TestGetTSCDefinition(t *testing.T) {
}

ok = definition.Label == targetDefinition.Label
ok = definition.Detail == targetDefinition.Detail
ok = definition.Documentation == targetDefinition.Documentation
ok = definition.Format == targetDefinition.Format
ok = definition.GetInsertText() == targetDefinition.InsertText
ok = definition.Nargs() == targetDefinition.Nargs()
ok = len(definition.ArgType) == len(targetDefinition.ArgType)
ok = definition.ArgType[0] == targetDefinition.ArgType[0]
ok = ok && definition.Detail == targetDefinition.Detail
ok = ok && definition.Documentation == targetDefinition.Documentation
ok = ok && definition.Format == targetDefinition.Format
ok = ok && definition.GetInsertText() == targetDefinition.InsertText
ok = ok && definition.Nargs() == targetDefinition.Nargs()
ok = ok && len(definition.ArgType) == len(targetDefinition.ArgType)
ok = ok && definition.ArgType[0] == targetDefinition.ArgType[0]

if !ok {
t.Errorf("config.Config#GetTSCDefinition(\"<AM-\") got %v, want %v", definition, targetDefinition)
Expand Down
99 changes: 99 additions & 0 deletions config/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,33 @@ var DefaultConfig = []byte(`{
},
"tsc": {
"<2MV": {
"label": "<2MV",
"detail": "2nd player MoVe",
"documentation": "Move the other player next to the player who had executed the command (Switch).",
"format": "<2MV",
"insertText": "<2MV"
},
"<2PJ": {
"label": "<2PJ",
"detail": "2-Player Jump",
"documentation": "Jump to event X if in multiplayer mode (Switch).",
"format": "<2MVXXXX",
"insertText": "2PJ${1:0000}",
"argtype": [
"number"
]
},
"<ACH": {
"label": "<ACH",
"detail": "ACHievement",
"documentation": "Trigger Steam achievement X. No-op in the EGS/Humble Bundle version of the game.",
"format": "<ACHXXXX",
"insertText": "ACH${1:0000}",
"argtype": [
"number"
]
},
"<AE+": {
"label": "<AE+",
"detail": "Arms Energy +",
Expand Down Expand Up @@ -278,6 +305,17 @@ var DefaultConfig = []byte(`{
"direction"
]
},
"<FF-": {
"label": "<FF-",
"detail": "First Flag - (false)",
"documentation": "Set first flag in range X-Y to false (Switch).",
"format": "<FF-XXXX:YYYY",
"insertText": "FF-${1:0000}:${2:0000}",
"argtype": [
"number",
"number"
]
},
"<FL+": {
"label": "<FL+",
"detail": "FLag +",
Expand Down Expand Up @@ -355,6 +393,13 @@ var DefaultConfig = []byte(`{
"number"
]
},
"<FR2": {
"label": "<FR2",
"detail": "FRee 2",
"documentation": "Free game action and PCs (Switch multiplayer).",
"format": "<FR2",
"insertText": "FR2"
},
"<FRE": {
"label": "<FRE",
"detail": "FREe",
Expand All @@ -372,6 +417,13 @@ var DefaultConfig = []byte(`{
"item"
]
},
"<HM2": {
"label": "<HM2",
"detail": "Hide My character 2",
"documentation": "Hide the player who executed the event (Switch).",
"format": "<HM2",
"insertText": "HM2"
},
"<HMC": {
"label": "<HMC",
"detail": "Hide My Character",
Expand All @@ -386,6 +438,18 @@ var DefaultConfig = []byte(`{
"format": "<INI",
"insertText": "INI"
},
"<INJ": {
"label": "<INJ",
"detail": "Item Number Jump",
"documentation": "Jump to event Z if amount of item X equals Y (Switch).",
"format": "<INJXXXX:YYYY:ZZZZ",
"insertText": "INJ${1:0000}:${2:0000}:${3:0000}",
"argtype": [
"item",
"number",
"number"
]
},
"<INP": {
"label": "<INP",
"detail": "[Initialize?] NPc",
Expand Down Expand Up @@ -429,6 +493,24 @@ var DefaultConfig = []byte(`{
"number"
]
},
"<I+N": {
"label": "<I+N",
"detail": "Item + N",
"documentation": "Adds item X with maximum amount of Y (Switch).",
"format": "<I+NXXXX:YYYY",
"insertText": "I+N${1:0000}:${2:0000}",
"argtype": [
"item",
"number"
]
},
"<KE2": {
"label": "<KE2",
"detail": "KEY lock for multiplayer",
"documentation": "Lock player controls and hide status bars until <END (Switch multiplayer).",
"format": "<KE2",
"insertText": "KE2"
},
"<KEY": {
"label": "<KEY",
"detail": "KEY lock",
Expand Down Expand Up @@ -597,13 +679,30 @@ var DefaultConfig = []byte(`{
"number"
]
},
"<POP": {
"label": "<POP",
"detail": "POP text script state",
"documentation": "Restore text script state from stack and resume previous event (Switch).",
"format": "<POP",
"insertText": "POP"
},
"<PRI": {
"label": "<PRI",
"detail": "PRevent Interaction",
"documentation": "Lock player controls and freeze game action until KEY or END.",
"format": "<PRI",
"insertText": "PRI"
},
"<PSH": {
"label": "<PSH",
"detail": "PuSH text script state",
"documentation": "Push the current script state onto the stack and start event X (Switch).",
"format": "<PSHXXXX",
"insertText": "PSH${1:0000}",
"argtype": [
"number"
]
},
"<PS+": {
"label": "<PS+",
"detail": "Portal Slot +",
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func main() {
app := cli.NewApp()
app.Name = "tsc-ls"
app.Usage = "language Server for the TSC scripting language"
app.Version = "0.1.5"
app.Version = "0.1.6"

app.Commands = []*cli.Command{
{
Expand Down

0 comments on commit 823fdd7

Please sign in to comment.