forked from Sichii/Chaos-Server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- updated ChaosTool for the MaterialDesignThemes migration - added ThrowScript to chaos
- Loading branch information
Showing
21 changed files
with
190 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using Chaos.Common.Definitions; | ||
using Chaos.Extensions.Geometry; | ||
using Chaos.Models.Data; | ||
using Chaos.Models.Panel; | ||
using Chaos.Models.World; | ||
using Chaos.Scripting.SkillScripts.Abstractions; | ||
|
||
namespace Chaos.Scripting.SkillScripts; | ||
|
||
public class ThrowScript : SkillScriptBase | ||
{ | ||
private readonly Animation ThrowAnimation = new() | ||
{ | ||
AnimationSpeed = 100, | ||
TargetAnimation = 123 | ||
}; | ||
|
||
/// <inheritdoc /> | ||
public ThrowScript(Skill subject) | ||
: base(subject) { } | ||
|
||
/// <inheritdoc /> | ||
public override void OnUse(ActivationContext context) | ||
{ | ||
var throwDirection = context.Source.Direction; | ||
var thrownPoint = context.Source.DirectionalOffset(throwDirection); | ||
var thrownAislings = context.TargetMap.GetEntitiesAtPoint<Aisling>(thrownPoint); | ||
var targetPoint = thrownPoint.DirectionalOffset(throwDirection); | ||
|
||
//potential points are the throw point, and the 3 points around it | ||
var potentialTargetPoints = targetPoint.GenerateCardinalPoints() | ||
.WithConsistentDirectionBias(throwDirection) | ||
.SkipLast(1) | ||
.Prepend(targetPoint) | ||
.ToList(); | ||
|
||
foreach (var aisling in thrownAislings) | ||
{ | ||
foreach (var point in potentialTargetPoints) | ||
if (context.SourceMap.IsWalkable(point, CreatureType.Aisling, false)) | ||
{ | ||
var aislingPoint = Point.From(aisling); | ||
aisling.WarpTo(point); | ||
|
||
context.SourceMap.ShowAnimation(ThrowAnimation.GetPointEffectAnimation(aislingPoint)); | ||
context.SourceMap.ShowAnimation(ThrowAnimation.GetPointEffectAnimation(point)); | ||
|
||
break; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
151CB6E025DB67AFAD566C0CC80406E39179551DA952E921DA8D24FB7DDF63A16A128B83690A16CB9A388BA6B782C961952076D672AE982D5D2E645037340AC5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"learningRequirements": { | ||
"itemRequirements": [ | ||
{ | ||
"amountRequired": 20, | ||
"itemTemplateKey": "apple" | ||
} | ||
], | ||
"requiredGold": 5000, | ||
"requiredStats": { | ||
"con": 1, | ||
"dex": 2, | ||
"int": 1, | ||
"str": 1, | ||
"wis": 1 | ||
}, | ||
"prerequisiteSkills": [], | ||
"prerequisiteSpells": [] | ||
}, | ||
"class": "Monk", | ||
"cooldownMs": 15000, | ||
"description": "Throws the target 1 or 2 spaces.", | ||
"level": 10, | ||
"name": "Throw", | ||
"panelSprite": 42, | ||
"scriptKeys": ["throw"], | ||
"scriptVars": {}, | ||
"templateKey": "throw" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.