feat: add creatures and drops on the map

This commit is contained in:
k0t9i
2023-02-07 22:21:15 +04:00
parent d03f37fbf7
commit 2480563914
13 changed files with 529 additions and 59 deletions

View File

@@ -1,4 +1,5 @@
using Client.Domain.ValueObjects;
using Client.Domain.Enums;
using Client.Domain.ValueObjects;
using System;
using System.Collections.Generic;
using System.ComponentModel;
@@ -15,6 +16,8 @@ namespace Client.Domain.Entities
Transform Transform { get; set; }
string Name { get; }
string BriefInfo { get; }
CreatureTypeEnum Type { get; }
uint AggroRadius { get; set; }
}
}

View File

@@ -1,4 +1,5 @@
using Client.Domain.Common;
using Client.Domain.Enums;
using Client.Domain.ValueObjects;
namespace Client.Domain.Entities
@@ -13,11 +14,11 @@ namespace Client.Domain.Entities
private string iconName;
public uint Id { get => id; set => id = value; }
public Transform Transform { get => transform; set { if (value != transform) { transform = value; OnPropertyChanged("Transform"); } } }
public uint ItemId { get => itemId; set { if (value != itemId) { itemId = value; OnPropertyChanged("ItemId"); } } }
public uint Amount { get => amount; set { if (value != amount) { amount = value; OnPropertyChanged("Amount"); } } }
public string Name { get => name; set { if (value != name) { name = value; OnPropertyChanged("Name"); } } }
public string IconName { get => iconName; set { if (value != iconName) { iconName = value; OnPropertyChanged("IconName"); } } }
public Transform Transform { get => transform; set { if (value != transform) { transform = value; OnPropertyChanged(); } } }
public uint ItemId { get => itemId; set { if (value != itemId) { itemId = value; OnPropertyChanged(); } } }
public uint Amount { get => amount; set { if (value != amount) { amount = value; OnPropertyChanged(); } } }
public string Name { get => name; set { if (value != name) { name = value; OnPropertyChanged(); } } }
public string IconName { get => iconName; set { if (value != iconName) { iconName = value; OnPropertyChanged(); } } }
public Drop(uint id, Transform transform, uint itemId, uint amount, string name, string iconName)
{

View File

@@ -1,4 +1,5 @@
using Client.Domain.Common;
using Client.Domain.Enums;
using Client.Domain.ValueObjects;
using System.ComponentModel;
using System.Diagnostics;
@@ -18,6 +19,7 @@ namespace Client.Domain.Entities
public uint TargetId { get => targetId; set { if (value != targetId) { targetId = value; OnPropertyChanged("TargetId"); } } }
public CreatureInterface? Target { get => target; set { if (value != target) { target = value; OnPropertyChanged("Target"); } } }
public bool IsStanding { get; set; }
public CreatureTypeEnum Type { get => CreatureTypeEnum.Hero; }
public FullName FullName
{
get => fullName;
@@ -59,6 +61,7 @@ namespace Client.Domain.Entities
return Phenotype.Race.ToString() + ", " + Phenotype.Class.ToString();
}
}
public uint AggroRadius { get; set; } = 0;
public Hero(uint id, Transform transform, FullName fullName, VitalStats vitalStats, Phenotype phenotype, ExperienceInfo experienceInfo, PermanentStats permanentStats, VariableStats variableStats, Reputation reputation, InventoryInfo inventoryInfo, uint targetId, bool isStanding)
{

View File

@@ -67,17 +67,17 @@ namespace Client.Domain.Entities
}
}
}
public string Name
{
get
{
string result = "";
string result = FullName.Nickname;
if (IsDead())
{
result += "Dead ";
result += " (dead)";
}
result += FullName.Nickname + "[" + NpcId + "]";
return result;
}
@@ -97,11 +97,12 @@ namespace Client.Domain.Entities
result += "*";
}
}
result += "<" + NpcId + ">";
result += " " + Level + "lvl";
return result;
}
}
public CreatureTypeEnum Type { get => CreatureTypeEnum.NPC; }
public NPC(uint id, Transform transform, bool isHostile, uint npcId, SpoilStateEnum spoilState, FullName fullName, VitalStats vitalStats)
{
Id = id;

View File

@@ -60,6 +60,8 @@ namespace Client.Domain.Entities
}
public VitalStats VitalStats { get => vitalStats; set => vitalStats = value; }
public CreatureTypeEnum Type { get => CreatureTypeEnum.Player; }
public uint AggroRadius { get; set; } = 0;
public Player(uint id, Transform transform, FullName fullName, Phenotype phenotype)
{