Skip to content

Commit

Permalink
-Overhauled the radiation calculation to take reactor integrity and p…
Browse files Browse the repository at this point in the history
…ower output into account

-Updated API libraries
-Updated game libraries
  • Loading branch information
chessmaster42 committed Aug 2, 2014
1 parent 50bb0b5 commit f818443
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 38 deletions.
Binary file modified Libraries/SEModAPI.dll
Binary file not shown.
Binary file modified Libraries/SEModAPIExtensions.dll
Binary file not shown.
Binary file modified Libraries/SEModAPIInternal.dll
Binary file not shown.
Binary file modified Libraries/Sandbox.Common.XmlSerializers.dll
Binary file not shown.
Binary file modified Libraries/Sandbox.Common.dll
Binary file not shown.
Binary file modified Libraries/VRage.Common.dll
Binary file not shown.
Binary file modified Libraries/VRage.Math.dll
Binary file not shown.
42 changes: 6 additions & 36 deletions ReactorRadiationPlugin/Core.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

namespace ReactorRadiationPlugin
{
public class Core : PluginBase, ICubeBlockEventHandler
public class Core : PluginBase
{
#region "Attributes"

Expand Down Expand Up @@ -140,38 +140,6 @@ public override void Shutdown()
m_isActive = false;
}

public void OnCubeBlockCreated(CubeBlockEntity cubeBlock)
{
if (!m_isActive)
return;

if (cubeBlock == null || cubeBlock.IsDisposed)
return;

CubeGridEntity cubeGrid = cubeBlock.Parent;

//Do some data validating
if (cubeGrid == null)
return;
if (cubeGrid.IsDisposed)
return;
if (cubeGrid.GridSizeEnum != MyCubeSize.Large)
return;

//TODO - Do stuff
}

public void OnCubeBlockDeleted(CubeBlockEntity cubeBlock)
{
if (!m_isActive)
return;

if (cubeBlock == null)
return;

//TODO - Do stuff
}

#endregion

private void CleanUpReactorMap()
Expand Down Expand Up @@ -269,10 +237,12 @@ private void DoRadiationDamage(List<CharacterEntity> targets, ReactorEntity sour
foreach (CharacterEntity character in targets)
{
double distance = Vector3.Distance(character.Position, reactorPos);
double range = 0.05 * source.Power * _RadiationRange;
if (distance < range)

float leakingRadiation = 0.1f + (0.5f * (1.0f / source.IntegrityPercent) - 0.5f);
float reactorRange = 5.0f + 0.2f * source.Power;
if (distance <= reactorRange)
{
double damage = _DamageRate * m_timeSinceLastUpdate.TotalSeconds * (range - distance);
double damage = _DamageRate * m_timeSinceLastUpdate.TotalSeconds * (reactorRange / distance) * leakingRadiation;
character.Health = character.Health - (float)damage;
}
}
Expand Down
4 changes: 2 additions & 2 deletions ReactorRadiationPlugin/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("0.1.1.0")]
[assembly: AssemblyFileVersion("0.1.1.0")]
[assembly: AssemblyVersion("0.2.0.0")]
[assembly: AssemblyFileVersion("0.2.0.0")]

0 comments on commit f818443

Please sign in to comment.