Defensive Stuff VS compat update

V.S. 1.15 update for 'Defensive Stuff'
This commit is contained in:
melchior 2021-08-03 19:38:28 -04:00
parent ae336e59f0
commit 02a4d1e659
6 changed files with 27 additions and 16 deletions

View file

@ -7,7 +7,7 @@
<OutputType>Library</OutputType>
<RootNamespace>FirstMachineAge</RootNamespace>
<AssemblyName>Assorted</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>

View file

@ -7,6 +7,7 @@ using System.Threading.Tasks;
using Vintagestory.API;
using Vintagestory.API.Common;
using Vintagestory.API.Config;
using Vintagestory.API.Datastructures;
using Vintagestory.API.MathTools;
using Vintagestory.API.Server;
using Vintagestory.GameContent;

View file

@ -5,12 +5,14 @@ using System.Linq;
using Vintagestory.API;
using Vintagestory.API.Common;
using Vintagestory.API.Datastructures;
using Vintagestory.API.MathTools;
namespace FirstMachineAge
{
public class BlockBehaviorNeedSides : BlockBehavior
{
private const string _applicableMatKey = @"applicableMaterials";
public EnumBlockMaterial[ ] ApplicableMaterials { get; private set; }
public BlockBehaviorNeedSides(Block block) : base(block)
@ -47,7 +49,7 @@ namespace FirstMachineAge
{
base.Initialize(properties);
this.ApplicableMaterials = properties[@"applicableMaterials"].FromEnumStrings<EnumBlockMaterial>();
this.ApplicableMaterials = properties[_applicableMatKey].FromEnumStrings<EnumBlockMaterial>();
}

View file

@ -142,23 +142,30 @@ namespace FirstMachineAge
{
if (api.Side.IsClient( )) {
var capi = api as ICoreClientAPI;
//Bits of broken block
var particleProps = new SimpleParticleProperties(9, 12, this.GetRandomColor(api as ICoreClientAPI, pos.Copy( ), BlockFacing.UP), pos.ToVec3d( ),pos.ToVec3d( ), Vec3f.Zero, Vec3f.Zero);
//int color = capi.BlockTextureAtlas.GetRandomColor(this.TextureSubIdForBlockColor);
//Bits of broken block
var particleProps = new SimpleParticleProperties
(7, 12,
0x808080,
pos.ToVec3d().Add(0.1, 0.75, 0.1),
pos.ToVec3d().Add(0.7, 0.0, 0.7),
Vec3f.Zero,
Vec3f.Zero,
5, //life length
0.8f, //gravity effect
0.25f, 0.7f, //min size, max size
EnumParticleModel.Cube); // quad or cube
particleProps.MinQuantity = 9;
particleProps.MinVelocity.Set(-0.05f, 0, -0.05f);
particleProps.AddVelocity.Set(0.5f, 0, 0.5f);
particleProps.WithTerrainCollision = true;
particleProps.ParticleModel = EnumParticleModel.Cube;
particleProps.LifeLength = 1.5f;
particleProps.GravityEffect = 2.5f;
particleProps.MinSize = 0.75f;
particleProps.MaxSize = 1.0f;
particleProps.ShouldSwimOnLiquid = true;
particleProps.WithTerrainCollision = true;
particleProps.WindAffected = false;
capi.World.SpawnParticles(particleProps);
//TODO: Sound
//TODO: Sound ?
}

View file

@ -5,6 +5,7 @@ using EnumsNET;
using Newtonsoft.Json.Linq;
using Vintagestory.API;
using Vintagestory.API.Datastructures;
using Vintagestory.API.MathTools;

View file

@ -3,10 +3,10 @@
"name": "Defensive Structures",
"description" : "Defensive structures and emplacements, ideal for stone castles...",
"authors": ["Melchior"],
"version": "0.1.4",
"version": "0.1.5",
"ModID":"defensive",
"dependencies": {
"game": "1.14.0",
"game": "1.15.3",
"survival": ""
},
"website": "http://noname.nope"