Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
70e59cc
starting replacing old resource state by the new one
WeylonSantana Mar 22, 2025
483c1bd
update sprite on server
WeylonSantana Mar 20, 2025
ceba4ea
finished on editor, adding controls and render on map
WeylonSantana Mar 20, 2025
32698cf
finished on client for now
WeylonSantana Mar 20, 2025
5a595ea
fix editor chebox name being cropped
WeylonSantana Mar 20, 2025
bc2c657
finish animation on editor
WeylonSantana Mar 20, 2025
a589b8e
added animation part in client
WeylonSantana Mar 21, 2025
daeec45
rename Graphic to Texture
WeylonSantana Mar 22, 2025
220f35b
renaming resource type enum and state property
WeylonSantana Mar 22, 2025
c5a24a0
renaming min/max hp from state
WeylonSantana Mar 22, 2025
893ef01
renaming tile/map properties in client resource
WeylonSantana Mar 22, 2025
70332a1
rename health to state
WeylonSantana Mar 22, 2025
df02af0
updating resource state type
WeylonSantana Mar 22, 2025
69bb298
add name and id to resouce state
WeylonSantana Mar 22, 2025
bb694de
correct type for current state key
WeylonSantana Mar 22, 2025
5547c9e
trying refactor resource
WeylonSantana Mar 22, 2025
6d90722
select the fullest resource
WeylonSantana Mar 22, 2025
acad5a9
more editor refactor
WeylonSantana Mar 22, 2025
e8d181a
rename controls
WeylonSantana Mar 22, 2025
edd6367
show correct name in editor
WeylonSantana Mar 22, 2025
8becfb8
sort states by health
WeylonSantana Mar 22, 2025
2a3bf37
bring back original code and change only necessary
WeylonSantana Mar 22, 2025
cdae5a4
everything working for tileset and texture
WeylonSantana Mar 22, 2025
031b8e3
undo map instance changes
WeylonSantana Mar 23, 2025
cf5c44b
fix hp bar not showing when has no graphic
WeylonSantana Mar 23, 2025
8207c29
making animations working on client side
WeylonSantana Mar 23, 2025
3101642
renaming state graphics => states
WeylonSantana Mar 23, 2025
1c22193
rename death animation and sort some things on editor
WeylonSantana Mar 23, 2025
e2081df
cache maximum health for states
WeylonSantana Mar 23, 2025
3abb611
dont update state if not necessary
WeylonSantana Mar 23, 2025
d4411f5
renaming current graphic state to current state
WeylonSantana Mar 23, 2025
69bab12
cache animation descriptor
WeylonSantana Mar 23, 2025
ccdd892
cache texture
WeylonSantana Mar 23, 2025
65f458f
cleanup on graphics
WeylonSantana Mar 26, 2025
805cc7b
dont handle resource sprite logic on server
WeylonSantana Mar 26, 2025
4ecf199
cleanup form resource
WeylonSantana Mar 26, 2025
ad72114
fix strings
WeylonSantana Mar 26, 2025
dd0fb5d
change items changed type
WeylonSantana Mar 26, 2025
f65f900
invert undo if
WeylonSantana Mar 26, 2025
63a3905
sort when hp state changes
WeylonSantana Mar 26, 2025
1b48080
renaming Texture => TextureName
WeylonSantana Mar 26, 2025
276e6cf
fix lst state items on editor
WeylonSantana Mar 26, 2025
70bae59
dispose animation when next state no longer uses
WeylonSantana Mar 27, 2025
53a9c39
do not render the white pixel occupying the whole tile when changing …
WeylonSantana Mar 27, 2025
830c6c4
fix rebasing
WeylonSantana Mar 27, 2025
9c2ef67
regenerating migration
WeylonSantana Mar 26, 2025
12b45f6
rename hpregen => HealthRegenPercent
WeylonSantana Mar 27, 2025
891d7e4
sort fields
WeylonSantana Mar 27, 2025
320dc8e
cleanup editor graphics
WeylonSantana Mar 27, 2025
db49e0a
cleanup resource on client
WeylonSantana Mar 27, 2025
f057779
fix small issues
WeylonSantana Mar 27, 2025
21bb25a
update max health on load
WeylonSantana Mar 28, 2025
80bc57b
using cached variables
WeylonSantana Mar 28, 2025
ef8bb4e
reusing position logic
WeylonSantana Mar 28, 2025
4ef0ad5
dont checking is dead twice
WeylonSantana Mar 28, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using Intersect.Framework.Core.GameObjects.Conditions;
using Intersect.Framework.Core.GameObjects.Events;
using Intersect.Framework.Core.GameObjects.Items;
using Intersect.GameObjects;
using Intersect.Models;
using Newtonsoft.Json;

Expand All @@ -23,32 +22,35 @@ public partial class ResourceDescriptor : DatabaseObject<ResourceDescriptor>, IF
public ResourceDescriptor(Guid id) : base(id)
{
Name = "New Resource";
Initial = new ResourceStateDescriptor();
Exhausted = new ResourceStateDescriptor();
}

//EF wants NO PARAMETERS!!!!!
public ResourceDescriptor()
{
Name = "New Resource";
Initial = new ResourceStateDescriptor();
Exhausted = new ResourceStateDescriptor();
}

// Graphics
public ResourceStateDescriptor Initial { get; set; }
public bool UseExplicitMaxHealthForResourceStates { get; set; }

public ResourceStateDescriptor Exhausted { get; set; }
[NotMapped, JsonIgnore]
public Dictionary<Guid, ResourceStateDescriptor> States { get; set; } = [];

[Column("Animation")]
public Guid AnimationId { get; set; }
[Column(nameof(States))]
public string JsonStates
{
get => JsonConvert.SerializeObject(States);
set => States = JsonConvert.DeserializeObject<Dictionary<Guid, ResourceStateDescriptor>>(value);
}

[Column(nameof(DeathAnimation))]
public Guid DeathAnimationId { get; set; }

[NotMapped]
[JsonIgnore]
public AnimationDescriptor Animation
public AnimationDescriptor DeathAnimation
{
get => AnimationDescriptor.Get(AnimationId);
set => AnimationId = value?.Id ?? Guid.Empty;
get => AnimationDescriptor.Get(DeathAnimationId);
set => DeathAnimationId = value?.Id ?? Guid.Empty;
}

// Drops
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
using Microsoft.EntityFrameworkCore;

namespace Intersect.Framework.Core.GameObjects.Resources;

[Owned]
public partial class ResourceStateDescriptor
{
public string Graphic { get; set; } = null;
public Guid Id { get; set; }

public string Name { get; set; }

public string? TextureName { get; set; } = default;

public ResourceTextureSource TextureType { get; set; } = ResourceTextureSource.Resource;

public bool RenderBelowEntities { get; set; }

public bool GraphicFromTileset { get; set; }
public Guid AnimationId { get; set; }

public int MinimumHealth { get; set; }

public int MaximumHealth { get; set; }

public int X { get; set; }

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace Intersect.Framework.Core.GameObjects.Resources;

public enum ResourceTextureSource
{
Resource,
Tileset,
Animation,
}
Loading
Loading