From 2445d42afa616ec0d1a517442e2c6d2b3e4431d9 Mon Sep 17 00:00:00 2001 From: Ojan Thornycroft Date: Sun, 26 Oct 2014 15:49:30 -0400 Subject: [PATCH 1/2] Displays the player's health bar after a world change if it is damaged and maintains the player's active weapon through worlds. --- DreamStateMachine/Game/Actor/ActorManager.cs | 8 ++++---- DreamStateMachine/Game/Rendering/Camera.cs | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/DreamStateMachine/Game/Actor/ActorManager.cs b/DreamStateMachine/Game/Actor/ActorManager.cs index 691489d..b597944 100644 --- a/DreamStateMachine/Game/Actor/ActorManager.cs +++ b/DreamStateMachine/Game/Actor/ActorManager.cs @@ -196,11 +196,11 @@ public void spawnActors(List spawns) if (spawn.className.Equals("player") && player != null) { actorToCopy = (Actor)player.Clone(); + actorToCopy.giveWeapon(player.activeWeapon); } else { - actorToCopy = (Actor)actorPrototypes[spawn.className].Clone(); - + actorToCopy = (Actor)actorPrototypes[spawn.className].Clone(); } actorToCopy.setGaze(newSightVector); spawnActor(actorToCopy, spawnTile, spawn.spawnType); @@ -226,13 +226,13 @@ public void respawnActors(List spawns) private void World_Change(Object sender, EventArgs eventArgs) { WorldManager worldManager = (WorldManager)sender; - player = worldManager.playerTransfer; if (worldManager.curWorld != null) { + player = worldManager.playerTransfer; List spawns = worldManager.curWorld.getSpawns(); spawnActors(spawns); + player = null; } - player = null; } } } diff --git a/DreamStateMachine/Game/Rendering/Camera.cs b/DreamStateMachine/Game/Rendering/Camera.cs index 43cf6d1..8b6a7fa 100644 --- a/DreamStateMachine/Game/Rendering/Camera.cs +++ b/DreamStateMachine/Game/Rendering/Camera.cs @@ -74,6 +74,10 @@ private void Actor_Spawn(object sender, EventArgs e) if (spawnedActor.className == "player") { protagonist = spawnedActor; + if (protagonist.health != protagonist.maxHealth) + { + healthBars[protagonist] = new HealthBar(protagonist, guiTextures["healthBar"]); + } //healthBar = new HealthBar(protagonist, healthBarTexture); } } From 7a0328b0f41679a3c3a06b2c38a2eadb80cb3de6 Mon Sep 17 00:00:00 2001 From: Ojan Thornycroft Date: Sun, 2 Nov 2014 14:54:39 -0500 Subject: [PATCH 2/2] Replacing all files with original files from main project. --- .../DSMContentProcessor/Actors.xml | 147 ++++++++- .../DSMContentProcessor/Animations.xml | 2 +- .../DSMContentProcessor.contentproj | 99 +++++- .../DSMContentProcessor/Music.xml | 16 + .../DSMContentProcessor/Sounds.xml | 21 ++ .../DSMContentProcessor/Weapons.xml | 3 +- .../DSMContentProcessor/Worlds.xml | 56 ++-- DreamStateMachine/DreamStateMachine.csproj | 4 + DreamStateMachine/Game/AI/AIController.cs | 4 +- DreamStateMachine/Game/Actor/Actor.cs | 2 + DreamStateMachine/Game/Actor/ActorManager.cs | 11 +- .../Game/Actor/Animations/Attack.cs | 11 +- DreamStateMachine/Game/Actor/Weapon.cs | 6 +- .../Game/Physics/Items/ItemManager.cs | 5 +- .../Game/Physics/PhysicsController.cs | 87 ++++- DreamStateMachine/Game/Rendering/Camera.cs | 296 +++++++++++++++--- DreamStateMachine/Game/Sound/Sound.cs | 20 ++ DreamStateMachine/Game/Sound/SoundManager.cs | 38 ++- DreamStateMachine/Game/World/Prop.cs | 56 +++- DreamStateMachine/Game/World/PropManager.cs | 92 +++++- DreamStateMachine/Game/World/Room.cs | 10 + DreamStateMachine/Game/World/SpawnFlag.cs | 1 + DreamStateMachine/Game/World/World.cs | 3 + DreamStateMachine/Game/World/WorldConfig.cs | 7 +- DreamStateMachine/Game/World/WorldFactory.cs | 153 ++++++++- DreamStateMachine/Game/World/WorldManager.cs | 80 ++--- DreamStateMachine/game.cs | 157 +++++++--- 27 files changed, 1178 insertions(+), 209 deletions(-) diff --git a/DSMContentProject/DSMContentProcessor/Actors.xml b/DSMContentProject/DSMContentProcessor/Actors.xml index cc6d216..545b8b7 100644 --- a/DSMContentProject/DSMContentProcessor/Actors.xml +++ b/DSMContentProject/DSMContentProcessor/Actors.xml @@ -9,6 +9,7 @@ texWidth="64" texHeight="64" health="100" + damageFactor="1" sight="200" reach="30"> @@ -18,29 +19,85 @@ - + + health="50" + damageFactor="1" + sight="400" + reach="25"> + + + + + + + + + + + + + + + + + + + + + @@ -48,6 +105,23 @@ + + + + + + + + + + + + @@ -64,6 +156,40 @@ + + + + + + + + + + + + diff --git a/DSMContentProject/DSMContentProcessor/Animations.xml b/DSMContentProject/DSMContentProcessor/Animations.xml index e093cc6..bcba60c 100644 --- a/DSMContentProject/DSMContentProcessor/Animations.xml +++ b/DSMContentProject/DSMContentProcessor/Animations.xml @@ -31,7 +31,7 @@ rowIndex="1"> + damage="20"> StainedGlassAndSpookySkeletons Mp3Importer - MGSongProcessor + MGSoundEffectProcessor PreserveNewest @@ -240,6 +240,7 @@ Worlds XmlImporter PassThroughProcessor + Designer @@ -273,7 +274,7 @@ LumiasGrove Mp3Importer - SongProcessor + MGSoundEffectProcessor PreserveNewest @@ -281,7 +282,7 @@ GoodNight Mp3Importer - SongProcessor + MGSoundEffectProcessor PreserveNewest @@ -289,7 +290,7 @@ CrystallineDreams Mp3Importer - SongProcessor + MGSoundEffectProcessor PreserveNewest @@ -297,7 +298,7 @@ Steps Mp3Importer - MGSongProcessor + MGSoundEffectProcessor PreserveNewest @@ -316,6 +317,7 @@ splashScreen TextureImporter TextureProcessor + PreserveNewest titlePanel @@ -333,6 +335,93 @@ TextureProcessor + + + creditsBtnUnfocused + TextureImporter + TextureProcessor + PreserveNewest + + + creditsBtnFocused + TextureImporter + TextureProcessor + PreserveNewest + + + + + golemAnimationsGreen + TextureImporter + TextureProcessor + PreserveNewest + + + golemAnimationsPink + TextureImporter + TextureProcessor + PreserveNewest + + + golemAnimationsRed + TextureImporter + TextureProcessor + PreserveNewest + + + skeletonAnimationsBlue + TextureImporter + TextureProcessor + PreserveNewest + + + skeletonAnimationsGreen + TextureImporter + TextureProcessor + PreserveNewest + + + skeletonAnimationsMask + TextureImporter + TextureProcessor + PreserveNewest + + + skeletonAnimationsPink + TextureImporter + TextureProcessor + PreserveNewest + + + skeletonAnimationsRed + TextureImporter + TextureProcessor + PreserveNewest + + + + + PreserveNewest + Props + XmlImporter + PassThroughProcessor + + + + + door + TextureImporter + TextureProcessor + + + + + potion + TextureImporter + TextureProcessor + PreserveNewest + +