Skip to content

Commit e21882b

Browse files
authored
Merge pull request #10 from wad4444/v2
Release 2.0.0
2 parents 7f92183 + ee8ab6a commit e21882b

86 files changed

Lines changed: 3055 additions & 4701 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22
/out
33
/include
44
*.tsbuildinfo
5-
/testing/out
5+
/testing/out
6+
/testing/include
7+
flamework.build

README.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
## WCS - A combat system framework
2-
3-
**WCS** is a *handy framework* that provides *useful abstraction* for your *combat systems*. It allows you to create **any kind of combat system** with **ease**, providing *tools* and *covering basic and tedious stuff*, like *replication*, *skill creation*, side effects, requests to server.*
4-
5-
**WCS** is made utilizing **[Typescript](<https://typescriptlang.org/>)** and compiled to luau using **[roblox-ts](<https://roblox-ts.com/>)**. It provides support for
6-
[roblox-ts](<https://roblox-ts.com/>) users and [luau](<https://luau-lang.org/>) users,
7-
by providing type definitions for both languages.
8-
9-
Please give feedback
10-
11-
[**Documentation**](<https://wad4444.github.io/WCS/>)
12-
[**GitHub Repository**](<https://github.com/wad4444/WCS>)
1+
<div align="center">
2+
<img src="docs/static/img/logo.svg" alt="WCS" width="150" />
3+
<br>
4+
<h style="font-size:2em;"><strong>WCS - A combat system framework<strong/></h>
5+
<br>
6+
<a style="font-size: 1.5em" href="https://wad4444.github.io/WCS/"><strong>View docs &rarr;</strong></a>
7+
<br><br><br>
8+
9+
Made with love by [@wAD](https://github.com/wad4444)❤️
10+
</div>

default.project.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
"$className": "Folder",
1313
"@rbxts": {
1414
"$path": "node_modules/@rbxts"
15+
},
16+
"@flamework": {
17+
"$path": "node_modules/@flamework"
1518
}
1619
}
1720
}

docs/docs/api/character.md

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,11 @@ Retrieves the character associated with the given instance.
4343
## Fields
4444

4545
### `Instance` **@readonly**
46-
4746
An instance *Character* object is attached to.
4847

48+
### `DisableSkills`
49+
A boolean value. Character's skills cannot be started if true.
50+
4951
### `Humanoid` **@readonly**
5052
A [Humanoid](https://create.roblox.com/docs/reference/engine/classes/Humanoid) associated with character's *instance*.
5153

@@ -66,6 +68,18 @@ Retrieved internally by `Players:GetPlayerFromCharacter(self.Instance)`.
6668
**`Parameters:`**
6769
* Skill: `Skill` - [A skill](./skill.md) that got removed.
6870

71+
### `SkillStarted`
72+
**An event**. Gets fired when [a skill](./skill.md) that is assigned to the character starts.
73+
74+
**`Parameters:`**
75+
* Skill: `Skill` - [A skill](./skill.md) that got started.
76+
77+
### `SkillEnded`
78+
**An event**. Gets fired when [a skill](./skill.md) that is assigned to the character ends.
79+
80+
**`Parameters:`**
81+
* Skill: `Skill` - [A skill](./skill.md) that got ended.
82+
6983
### `StatusEffectAdded`
7084
**An event**. Gets fired when [a status effect](./statusEffect.md) gets added to the character.
7185

@@ -78,6 +92,18 @@ Gets fired when [a status effect](./statusEffect.md) gets removed from the chara
7892
**`Parameters:`**
7993
* Status: `StatusEffect` - [A status effect](./skill.md) that got removed.
8094

95+
### `StatusEffectStarted`
96+
**An event**. Gets fired when [a status effect](./statusEffect.md) that is assigned to the character starts.
97+
98+
**`Parameters:`**
99+
* Status: `StatusEffect` - [A status effect](./skill.md) that got started.
100+
101+
### `StatusEffectEnded`
102+
Gets fired when [a status effect](./statusEffect.md) that is assigned to the character ends.
103+
104+
**`Parameters:`**
105+
* Status: `StatusEffect` - [A status effect](./skill.md) that got ended.
106+
81107
### `HumanoidPropertiesUpdated`
82108
Gets fired when character's [humanoid data](../tutorial/statuses/humanoid-data.md) gets updated.
83109

@@ -150,7 +176,7 @@ Returns the calculated damage.
150176
Sets default humanoid properties of the character.
151177

152178
**`Parameters:`**
153-
* Properties: `AffectableHumanoidProps` - A map of a `PropertyName` and it's `Value`.
179+
* Properties: `AffectableHumanoidProps` - A map of a `PropertyName` and its `Value`.
154180

155181
<Tabs groupId="languages">
156182
<TabItem value="TypeScript" default>
@@ -177,7 +203,13 @@ Char:SetDefaultProps({
177203
Retrieves the default humanoid properties of the character.
178204

179205
**`Returns`**
180-
* Properties: `AffectableHumanoidProps` - A map of a `PropertyName` and it's `Value`.
206+
* Properties: `AffectableHumanoidProps` - A map of a `PropertyName` and its `Value`.
207+
208+
### `GetAppliedProps()`
209+
Retrieves the currently applied humanoid properties, depending on current `HumanoidData`.
210+
211+
**`Returns`**
212+
* Properties: `AffectableHumanoidProps` - A map of a `PropertyName` and its `Value`.
181213

182214
### `GetAllStatusEffect()`
183215
Retrieves all status effects.
@@ -243,6 +275,12 @@ Applies a [Moveset] to the character.
243275
* Moveset: `Moveset | string` - A [Moveset] object or it's name.
244276

245277
### `GetMoveset()`
278+
Returns the current [Moveset].
279+
280+
**`Returns`**
281+
* Moveset: `Moveset?`
282+
283+
### `GetMovesetName()`
246284
Returns the current [Moveset]'s name.
247285

248286
**`Returns`**

docs/docs/api/skill.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,23 @@ import TOCInline from "@theme/TOCInline";
1919

2020
## Fields
2121

22-
### `Janitor` @readonly
22+
### `Janitor` **@readonly**
2323
A [Janitor] object. Cleans up everything after skill ends.
2424

25-
### `CooldownTimer` @readonly
25+
### `CooldownTimer` **@readonly**
2626
A [Timer] object. Starts, when `ApplyCooldown()` gets invoked on server. Does not sync to client.
2727

28-
### `Character` @readonly
28+
### `Character` **@readonly**
2929
A [Character] object this skill is tied with.
3030

31-
### `Player` @readonly
31+
### `Player` **@readonly**
3232
A [Player](https://create.roblox.com/docs/reference/engine/classes/Player) object the skill is associated with.
3333
Retrieved internally by `Players:GetPlayerFromCharacter(self.Character.Instance)`.
3434

35-
### `Name` @readonly
35+
### `Name` **@readonly**
3636
A string value.
3737

38-
### `ConstructorArguments` @readonly
38+
### `ConstructorArguments` **@readonly**
3939
A table of arguments provided after the [Character] in `.new()`.
4040

4141
### `CheckOthersActive`
@@ -44,6 +44,9 @@ A boolean value. Checks whenever other skills should be non active for :Start()
4444
### `CheckedByOthers`
4545
A boolean value. Determines if other skills should check if the skill is active to proceed.
4646

47+
### `ParamValidators`
48+
An array of `Validator` functions that validate your starter params.
49+
4750
### `MutualExclusives`
4851
`Constructor<AnyStatus>[]`. An array of [Status Effect] constructors. If any of them is applied to [Character] object whenever `Start()` is called,
4952
it will not proceed further and skill will not be started.
@@ -106,6 +109,9 @@ Returns true if the skill is destroyed / removed from the [Character].
106109
### `End()`
107110
Force end the skill. This is automatically called after OnStartServer() is completed.
108111

112+
### `Stop()` @alias
113+
Ends the skill. Alias for `End()`.
114+
109115
### `GetSkillType()`
110116
Retrieves the skill type.
111117

docs/docs/api/statusEffect.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,21 @@ import TOCInline from "@theme/TOCInline";
1212
[Character]: ../api/character.md
1313
[Timer]: https://www.npmjs.com/package/@rbxts/timer
1414
[Metadata]: ../tutorial/extras/metadata.md
15+
[Janitor]: https://howmanysmall.github.io/Janitor/
1516

1617
## Fields
1718

18-
### `Character` @readonly
19+
### `Character` **@readonly**
1920
A [Character] object this status effect is tied with.
2021

21-
### `ConstructorArguments` @readonly
22+
### `Janitor` **@readonly**
23+
A [Janitor] object. Cleans up everything after skill ends.
24+
25+
### `Player` **@readonly**
26+
A [Player](https://create.roblox.com/docs/reference/engine/classes/Player) object the skill is associated with.
27+
Retrieved internally by `Players:GetPlayerFromCharacter(self.Character.Instance)`.
28+
29+
### `ConstructorArguments` **@readonly**
2230
A table of arguments provided after the [Character] in `.new()`.
2331

2432
### `DestroyOnEnd`
@@ -76,11 +84,11 @@ Starts the status effect.
7684
**`Parameters:`**
7785
* Time: `number?`
7886

79-
### `Stop()`
80-
Stops the status effect.
87+
### `End()`
88+
Ends the status effect.
8189

82-
### `End()` @alias
83-
Stops the status effect. Alias for `Stop()`.
90+
### `Stop()` @alias
91+
Ends the status effect. Alias for `End()`.
8492

8593
### `Pause()`
8694
Pauses the internal status effect [Timer].

docs/docs/api/wcs.md

Lines changed: 24 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -19,104 +19,65 @@ If called more than once returns the same [server](./server.md) object.
1919
**`Returns:`**
2020
* [Server](./server.md)
2121

22-
<Tabs groupId="languages">
23-
<TabItem value="TypeScript" default>
24-
25-
```ts
26-
const Server = CreateServer();
27-
```
28-
29-
</TabItem>
30-
<TabItem value="Luau">
31-
32-
```lua
33-
local Server = WCS.CreateServer()
34-
```
35-
36-
</TabItem>
37-
</Tabs>
38-
3922
## `CreateClient()`
4023
Creates a [Client](./client.md) object and returns it.
4124
If called more than once returns the same [client](./client.md) object.
4225

43-
<Tabs groupId="languages">
44-
<TabItem value="TypeScript" default>
45-
46-
```ts
47-
const Client = CreateClient();
48-
```
49-
50-
</TabItem>
51-
<TabItem value="Luau">
52-
53-
```lua
54-
local Client = WCS.CreateClient()
55-
```
56-
57-
</TabItem>
58-
</Tabs>
59-
6026
**`Returns:`**
6127
* [Client](./client.md)
6228

63-
## `RegisterStatusEffect(name)`
29+
## `RegisterStatusEffect(name, extendsFrom)`
6430
Registers a new [status effect](./statusEffect.md) with name specified in an argument.
6531

6632
**`Parameters:`**
6733
* Name: `string`
34+
* ExtendsFrom: `StatusEffectImpl`
6835

6936
**`Returns:`**
7037
* [StatusEffect](./statusEffect.md)
7138

72-
```lua
73-
local SpeedBoost = WCS.RegisteredStatusEffect("SpeedBoost")
74-
```
75-
76-
## `RegisterSkill(name)`
39+
## `RegisterSkill(name, extendsFrom)`
7740
Registers a new [skill](./skill.md) with name specified in an argument.
7841

7942
**`Parameters:`**
8043
* Name: `string`
44+
* ExtendsFrom: `Skill`
8145

8246
**`Returns:`**
8347
* [Skill](./skill.md)
8448

85-
```lua
86-
local Attack = WCS.RegisterSkill("Attack")
87-
```
49+
## `RegisterHoldableSkill(name, extendsFrom)`
50+
Registers a new [holdable skill](../tutorial/skills/holdable.md) with name specified in an argument.
51+
52+
**`Parameters:`**
53+
* Name: `string`
54+
* ExtendsFrom: `Skill`
8855

89-
## `Character`
90-
An exported [character](./character.md) class. Cannot be changed.
56+
**`Returns:`**
57+
* [Holdable Skill](../tutorial/skills/holdable.md)
58+
59+
## `DefineMessage(fn, config)`
60+
Registers a [message](../tutorial/messages/intro.md).
61+
62+
**`Parameters:`**
63+
* Function: `function`
64+
* Config: `MessageConfig`
65+
66+
## `Character` **@readonly**
67+
An exported [character](./character.md) class.
9168

92-
## `CreateMoveset(name, skills)`
69+
## `CreateMoveset(name, skills, constructorArgs)`
9370
Creates a [Moveset] object and returns it.
9471
Accepts the name and array of skills.
9572

9673
**`Parameters:`**
9774
* Name: `string`
9875
* Skills: ```{AnySkillConstructor}```
76+
* ConstructorArguments: ```{[string | SkillImpl]: any[]}``` - an object that contains array of `ConstructorArguments` that skill should get instantiated with.
9977

10078
**`Returns:`**
10179
* [Moveset]
10280

103-
<Tabs groupId="languages">
104-
<TabItem value="TypeScript" default>
105-
106-
```ts
107-
const Moveset = CreateMoveset("Mage", [Attack]);
108-
```
109-
110-
</TabItem>
111-
<TabItem value="Luau">
112-
113-
```lua
114-
local Client = WCS.CreateMoveset("Mage", {Attack})
115-
```
116-
117-
</TabItem>
118-
</Tabs>
119-
12081
## `GetMovesetObjectByName(name)`
12182
Retrieves [Moveset] object by its name if registered.
12283

@@ -126,27 +87,9 @@ Retrieves [Moveset] object by its name if registered.
12687
**`Returns:`**
12788
* Moveset: [`Moveset?`](../tutorial/extras/movesets.md)
12889

129-
<Tabs groupId="languages">
130-
<TabItem value="TypeScript" default>
131-
132-
```ts
133-
const Moveset = GetMovesetObjectByName("Mage");
134-
```
135-
136-
</TabItem>
137-
<TabItem value="Luau">
138-
139-
```lua
140-
local Moveset = WCS.GetMovesetObjectByName("Mage")
141-
```
142-
143-
</TabItem>
144-
</Tabs>
145-
14690
## `SkillType`
14791
An exported skill type enum.
14892

149-
15093
`Members:`
15194
```
15295
Default,

docs/docs/tutorial/basics/client-server.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ local WCS = require(ReplicatedStorage.WCS)
8989

9090
local Client = WCS.CreateClient()
9191

92-
Client:RegisterDirectory(ReplicatedStorage.TS.movesets)
93-
Client:RegisterDirectory(ReplicatedStorage.TS.skills)
94-
Client:RegisterDirectory(ReplicatedStorage.TS.statusEffects)
92+
Client:RegisterDirectory(ReplicatedStorage.movesets)
93+
Client:RegisterDirectory(ReplicatedStorage.skills)
94+
Client:RegisterDirectory(ReplicatedStorage.statusEffects)
9595

9696
Client:Start()
9797
```

0 commit comments

Comments
 (0)