Skip to content

Commit

Permalink
Initial RL1 source release
Browse files Browse the repository at this point in the history
  • Loading branch information
flibitijibibo committed Oct 11, 2024
0 parents commit 09bb3f3
Show file tree
Hide file tree
Showing 311 changed files with 163,505 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
## The Basics

Thanks for making a pull request! Before making a pull request, we have some
things for you to read through first:

- We generally do not accept patches for formatting fixes, unless the formatting
fixes are part of a functional patch (for example, when fixing a bug in a
function you can fix up the lines surrounding it if needed).
- Patches that break compatibility with the original game data or save data will
not be accepted.
- New features and user interface changes will most likely not be accepted
unless they are for improving user accessibility.
- New platforms are acceptable if they use FNA and don't mess with the game
source too much.
- (No homebrew console targets, sorry! Maybe do the work in SDL instead?)
- Translations and localizations of the game are not a community effort. If you
want to translate the game, you should contact Cellar Door Games.
- Pull requests that do not fill out the Legal Stuff will be closed
automatically.

If you understand these notes, you can delete the text in this section. Pull
requests that still have this text will be closed automatically.


## Changes:

Describe your patch here!


## Legal Stuff:

By submitting this pull request, I confirm that...

- [ ] My changes may be used in a future commercial release of Rogue Legacy
- [ ] I will be credited in a `CONTRIBUTORS` file and the "GitHub Friends"
section of the credits for all of said releases, but will NOT be compensated
for these changes unless there is a prior written agreement
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: CI

on: [push, pull_request]

jobs:
linux:
name: Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true

- name: Clone FNA
run: |
git clone --recursive https://github.com/FNA-XNA/FNA.git
mv FNA ../FNA
- name: dotnet build (Debug)
run: |
dotnet build -c Debug
- name: dotnet build (Release)
run: |
dotnet build -c Release
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
bin/
obj/
obj_core/
*.pidb
*.user
*.userprefs
*.suo
*.vs
25 changes: 25 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "mono",
"request": "launch",
"program": "${workspaceRoot}/RogueCastle/bin/x64/Debug/net40/RogueLegacy.exe",
"cwd": "${workspaceRoot}/RogueCastle/bin/x64/Debug/net40/",
"env": {
"LD_LIBRARY_PATH": "${workspaceRoot}/fnalibs3/lib64/"
}
},
{
"name": "Attach",
"type": "mono",
"request": "attach",
"address": "localhost",
"port": 55555
}
]
}
26 changes: 26 additions & 0 deletions DS2DEngine/DS2DEngine.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>net40</TargetFramework>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\InputSystem\InputSystem.csproj">
<Project>{4EFA1C2F-A065-4520-A8AC-A71EA1751C54}</Project>
<Name>InputSystem</Name>
</ProjectReference>
<ProjectReference Include="..\SpriteSystem\SpriteSystem.csproj">
<Project>{92C40872-2B5C-4894-AABB-602547E1DFC3}</Project>
<Name>SpriteSystem</Name>
</ProjectReference>
<ProjectReference Include="..\Tweener\Tweener.csproj">
<Project>{D9583122-AC6D-41EB-8292-04BDD0519D7C}</Project>
<Name>Tweener</Name>
</ProjectReference>
<ProjectReference Include="..\..\FNA\FNA.NetFramework.csproj">
<Project>{35253CE1-C864-4CD3-8249-4D1319748E8F}</Project>
<Name>FNA</Name>
</ProjectReference>
</ItemGroup>
</Project>
47 changes: 47 additions & 0 deletions DS2DEngine/src/AI Logic/Actions/ChangePropertyLogicAction.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

namespace DS2DEngine
{
public class ChangePropertyLogicAction : LogicAction
{
private string m_propertyName;
private object m_propertyArg;
private object m_object;

public ChangePropertyLogicAction(object propertyObject, string propertyName, object propertyArg)
{
m_object = propertyObject;
m_propertyName = propertyName;
m_propertyArg = propertyArg;
}

public override void Execute()
{
if (ParentLogicSet != null && ParentLogicSet.IsActive)
{
PropertyInfo propertyInfo = m_object.GetType().GetProperty(m_propertyName);
propertyInfo.SetValue(m_object, m_propertyArg, null);
base.Execute();
}
}

public override object Clone()
{
return new ChangePropertyLogicAction(m_object, m_propertyName, m_propertyArg);
}

public override void Dispose()
{
if (IsDisposed == false)
{
m_propertyArg = null;
m_object = null;
base.Dispose();
}
}
}
}
119 changes: 119 additions & 0 deletions DS2DEngine/src/AI Logic/Actions/ChangeSpriteLogicAction.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tweener;
using Tweener.Ease;

namespace DS2DEngine
{
public class ChangeSpriteLogicAction : LogicAction
{
private string m_spriteName;
private bool m_playAnimation;
private bool m_loopAnimation;

//private TweenObject m_tweenDelay;
//private BlankObj m_blankObj; // Storing the blank object so that we can dispose it properly later.
private IAnimateableObj m_animateableObj;

public ChangeSpriteLogicAction(string spriteName, bool playAnimation = true, bool loopAnimation = true)
{
m_spriteName = spriteName;
m_playAnimation = playAnimation;
m_loopAnimation = loopAnimation;
//m_blankObj = new BlankObj(1, 1);
}

public override void Execute()
{
if (ParentLogicSet != null && ParentLogicSet.IsActive == true)
{
m_animateableObj = this.ParentLogicSet.ParentGameObj as IAnimateableObj;
if (m_animateableObj != null && (m_animateableObj.SpriteName != m_spriteName || m_animateableObj.IsAnimating == false))
{
this.ParentLogicSet.ParentGameObj.ChangeSprite(m_spriteName);
if (m_playAnimation == true)
{
m_animateableObj.PlayAnimation(m_loopAnimation);
//if (SequenceType == Types.Sequence.Serial && animateableObj.IsLooping == false)
//{
// m_tweenDelay = Tween.To(m_blankObj, animateableObj.TotalFrames, Linear.EaseNone, "X", "1");
// m_tweenDelay.UseTicks = true;
//}
}
}
base.Execute();
}
}

public override void Update(Microsoft.Xna.Framework.GameTime gameTime)
{
this.ExecuteNext();
base.Update(gameTime);
}

public override void ExecuteNext()
{
if (m_playAnimation == false || m_loopAnimation == true || (m_animateableObj != null && SequenceType == Types.Sequence.Serial && m_animateableObj.IsLooping == false && m_animateableObj.IsAnimating == false))
{
base.ExecuteNext();
}
}

//public override void ExecuteNext()
//{
// if (m_tweenDelay != null)
// {
// if (NextLogicAction != null)
// m_tweenDelay.EndHandler(NextLogicAction, "Execute");
// else
// m_tweenDelay.EndHandler(ParentLogicSet, "ExecuteComplete");
// }
// else
// base.ExecuteNext();
//}

public override void Stop()
{
// Okay. Big problem with delay tweens. Because logic actions are never disposed in-level (due to garbage collection concerns) the reference to the delay tween in this logic action will exist until it is
// disposed, EVEN if the tween completes. If the tween completes, it goes back into the pool, and then something else will call it, but this logic action's delay tween reference will still be pointing to it.
// This becomes a HUGE problem if this logic action's Stop() method is called, because it will then stop the tween that this tween reference is pointing to.
// The solution is to comment out the code below. This means that this tween reference will always call it's endhandler, which in this case is either Execute() or ExecuteComplete(). This turns out
// to not be a problem, because when a logic set is called to stop, its IsActive flag is set to false, and all Execute() methods in logic actions have to have their parent logic set's IsActive flag to true
// in order to run. Therefore, when the tween calls Execute() or ExecuteComplete() nothing will happen.
// - This bug kept you confused for almost 5 hours. DO NOT FORGET IT. That is what this long explanation is for.
// TL;DR - DO NOT UNCOMMENT THE CODE BELOW OR LOGIC SETS BREAK.

//if (m_tweenDelay != null)
// m_tweenDelay.StopTween(false);

IAnimateableObj obj = this.ParentLogicSet.ParentGameObj as IAnimateableObj;
if (obj != null)
obj.StopAnimation();
base.Stop();
}

public override void Dispose()
{
if (IsDisposed == false)
{
// See above for explanation.
//if (m_tweenDelay != null)
// m_tweenDelay.StopTween(false);

//m_tweenDelay = null;
//m_blankObj.Dispose();
//m_blankObj = null;
m_animateableObj = null;

base.Dispose();
}
}

public override object Clone()
{
return new ChangeSpriteLogicAction(m_spriteName, m_playAnimation, m_loopAnimation);
}
}
}
38 changes: 38 additions & 0 deletions DS2DEngine/src/AI Logic/Actions/ChangeStateLogicAction.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DS2DEngine
{
public class ChangeStateLogicAction : LogicAction
{
private int m_state;

public ChangeStateLogicAction(int state)
{
m_state = state;
}

public override void Execute()
{
if (ParentLogicSet != null && ParentLogicSet.IsActive == true)
{
if (ParentLogicSet.ParentGameObj is IStateObj)
(ParentLogicSet.ParentGameObj as IStateObj).State = m_state;
base.Execute();
}
}

public override object Clone()
{
return new ChangeStateLogicAction(m_state);
}

public override void Dispose()
{
if (IsDisposed == false)
base.Dispose();
}
}
}
33 changes: 33 additions & 0 deletions DS2DEngine/src/AI Logic/Actions/ChangeWeightLogicAction.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DS2DEngine
{
public class ChangeWeightLogicAction : LogicAction
{
private bool m_isWeighted = false;

public ChangeWeightLogicAction(bool isWeighted)
{
m_isWeighted = isWeighted;
}

public override void Execute()
{
if (ParentLogicSet != null && ParentLogicSet.IsActive == true)
{
IPhysicsObj physicsObj = ParentLogicSet.ParentGameObj as IPhysicsObj;
if (physicsObj != null)
physicsObj.IsWeighted = m_isWeighted;
base.Execute();
}
}

public override object Clone()
{
return new ChangeWeightLogicAction(m_isWeighted);
}
}
}
Loading

0 comments on commit 09bb3f3

Please sign in to comment.