Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
04aece4
no idea what i'm doing here
Glimps3 Aug 7, 2024
1da1b3d
attackscript files changed for Range Adjust
Glimps3 Aug 7, 2024
139c7d2
More file changes for Range Adjust
Glimps3 Aug 7, 2024
71d89da
Text files with info on changes
Glimps3 Aug 7, 2024
bc68820
Range Adjust stuff
Glimps3 Aug 7, 2024
fcaa7fb
Delete Toggle Shadow Decal Edit - Testing and Other Fun Information.txt
Glimps3 Aug 7, 2024
1221c23
Delete Disable Editor In Media Mode - Testing and Other Fun Informati…
Glimps3 Aug 7, 2024
294990c
fixed script formatting
Glimps3 Aug 7, 2024
b2fe484
fixed script formatting
Glimps3 Aug 7, 2024
06bf333
fixed formatting
Glimps3 Aug 7, 2024
855405b
missed a line
Glimps3 Aug 7, 2024
b1b63a8
Add files via upload
Glimps3 Aug 7, 2024
d05f1df
Add files via upload
Glimps3 Aug 9, 2024
e068f9b
Add files via upload
Glimps3 Aug 9, 2024
3c5fdc4
Add files via upload
Glimps3 Aug 9, 2024
f3a8099
Add files via upload
Glimps3 Aug 9, 2024
4678918
Add files via upload
Glimps3 Aug 9, 2024
c140c11
Add files via upload
Glimps3 Aug 9, 2024
1e0557f
Delete Range Adjust - Testing and Other Fun Information.txt
Glimps3 Sep 10, 2024
78fab3d
Delete roundhouse (big range - 101.5 to be exact).xml
Glimps3 Sep 10, 2024
084bd87
Delete roundhouse (small range - 0.1 to be exact).xml
Glimps3 Sep 10, 2024
19c2c1e
Delete spearslash.xml
Glimps3 Sep 10, 2024
b2d3a6c
Delete spearslashclose.xml
Glimps3 Sep 10, 2024
e55c9f1
Delete spearstab.xml
Glimps3 Sep 10, 2024
bbd2c48
Delete spearstabfar.xml
Glimps3 Sep 10, 2024
924ee7e
Delete spearsweep.xml
Glimps3 Sep 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions Data/Scripts/aschar.as
Original file line number Diff line number Diff line change
Expand Up @@ -7333,8 +7333,14 @@ void HandleAnimationCombatEvent(const string &in event, const vec3 &in world_pos
range_extend += mix(1.0, 0.0, game_difficulty);
range_extend *= mix(1.0, 0.0, game_difficulty);
}

if(event == "attackblocked" || distance(this_mo.position, target_pos) < (_attack_range + range_extend) * this_mo.rigged_object().GetCharScale()) {

float range_adjust = 0.0f;

if(attack_getter.HasRangeAdjust()){
range_adjust = attack_getter.GetRangeAdjust();
}

if(event == "attackblocked" || distance(this_mo.position, target_pos) < (_attack_range + range_extend + range_adjust) * this_mo.rigged_object().GetCharScale()) {
vec3 facing = this_mo.GetFacing();
vec3 facing_right = vec3(-facing.z, facing.y, facing.x);
vec3 dir = normalize(target_pos - this_mo.position);
Expand Down
8 changes: 8 additions & 0 deletions Source/Asset/Asset/attacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ void Attack::clear() {
damage[1] = 0.0f;
force[0] = 0.0f;
force[1] = 0.0f;
has_range_adjust = false;
range_adjust = 0.0f;
unblockable = false;
flesh_unblockable = false;
mobile = false;
Expand Down Expand Up @@ -191,6 +193,12 @@ int Attack::Load(const string& path, uint32_t load_flags) {
} else if (field_str == "force") {
GetRange(field, "val", "min", "max", force[0], force[1]);
}
else if (field_str == "range_adjust")
{
has_range_adjust = true;
field->QueryFloatAttribute("val", &range_adjust);
//GetRange(field, "val", "min", "max", range_adjust[0], range_adjust[1]);
}
}
} else {
return kLoadErrorMissingFile;
Expand Down
2 changes: 2 additions & 0 deletions Source/Asset/Asset/attacks.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ class Attack : public AssetInfo {
float block_damage[2];
float damage[2];
float force[2];
bool has_range_adjust;
float range_adjust;
string materialevent;
vec3 cut_plane;
bool has_cut_plane;
Expand Down
10 changes: 10 additions & 0 deletions Source/Game/attackscript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,14 @@ float AttackScriptGetter::GetForce() {
return attack_ref_.valid() ? RangedRandomFloat(attack_ref_->force[0], attack_ref_->force[1]) : 0.0f;
}

bool AttackScriptGetter::HasRangeAdjust() {
return attack_ref_.valid() ? attack_ref_->has_range_adjust : false;
}

float AttackScriptGetter::GetRangeAdjust() {
return attack_ref_.valid() ? attack_ref_->range_adjust : 0.0f;
}

std::string AttackScriptGetter::GetPath() {
return path_;
}
Expand Down Expand Up @@ -188,6 +196,8 @@ void AttachAttackScriptGetter(ASContext *as_context) {
as_context->RegisterObjectMethod("AttackScriptGetter", "float GetSharpDamage()", asMETHOD(AttackScriptGetter, GetSharpDamage), asCALL_THISCALL);
as_context->RegisterObjectMethod("AttackScriptGetter", "float GetDamage()", asMETHOD(AttackScriptGetter, GetDamage), asCALL_THISCALL);
as_context->RegisterObjectMethod("AttackScriptGetter", "float GetForce()", asMETHOD(AttackScriptGetter, GetForce), asCALL_THISCALL);
as_context->RegisterObjectMethod("AttackScriptGetter", "bool HasRangeAdjust()", asMETHOD(AttackScriptGetter, HasRangeAdjust), asCALL_THISCALL);
as_context->RegisterObjectMethod("AttackScriptGetter", "float GetRangeAdjust()", asMETHOD(AttackScriptGetter, GetRangeAdjust), asCALL_THISCALL);
as_context->RegisterObjectMethod("AttackScriptGetter", "int GetMirrored()", asMETHOD(AttackScriptGetter, GetMirrored), asCALL_THISCALL);
as_context->RegisterObjectMethod("AttackScriptGetter", "int GetMobile()", asMETHOD(AttackScriptGetter, GetMobile), asCALL_THISCALL);
as_context->DocsCloseBrace();
Expand Down
2 changes: 2 additions & 0 deletions Source/Game/attackscript.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ class AttackScriptGetter {
float GetSharpDamage();
float GetDamage();
float GetForce();
bool HasRangeAdjust();
float GetRangeAdjust();
std::string GetPath();
std::string GetSpecial();
int GetUnblockable();
Expand Down