Skip to content

Commit

Permalink
changes for better video
Browse files Browse the repository at this point in the history
  • Loading branch information
rytisgit committed Feb 24, 2020
1 parent dead200 commit 8dff75b
Show file tree
Hide file tree
Showing 40 changed files with 209 additions and 79 deletions.
2 changes: 1 addition & 1 deletion Character/Character.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Character</RootNamespace>
<AssemblyName>Character</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
Expand Down
4 changes: 4 additions & 0 deletions Extra/features.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ lava
deep_water
≈CYAN
shallow_water
≈LIGHTCYAN
shoals_shallow_water9
.RED
floor
.GREEN
Expand Down Expand Up @@ -134,6 +136,8 @@ passage_of_golubria
shaft
^LIGHTGREY
net
^LIGHTCYAN
net
∩YELLOW
enter_shop
∩LIGHTGREY
Expand Down
32 changes: 32 additions & 0 deletions Extra/items.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,38 @@ ivory
ivory
=WHITE
ivory
"BLACK
filigree
"RED
filigree
"GREEN
filigree
"BROWN
filigree
"BLUE
filigree
"MAGENTA
filigree
"CYAN
filigree
"LIGHTGREY
filigree
"DARKGREY
filigree
"LIGHTRED
filigree
"LIGHTGREEN
filigree
"YELLOW
filigree
"LIGHTBLUE
filigree
"LIGHTMAGENTA
filigree
"LIGHTCYAN
filigree
"WHITE
filigree
$BLACK
16
$RED
Expand Down
Binary file added Extra/rltiles/dngn/floor/rough_magenta3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Extra/rltiles/dngn/wall/zot_magenta1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Extra/rltiles/mon/draco/draconian_annihilator.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Extra/rltiles/mon/draco/draconian_knight.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Extra/rltiles/mon/draco/draconian_monk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Extra/rltiles/mon/draco/draconian_scorcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Extra/rltiles/mon/draco/draconian_shifter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Extra/rltiles/mon/draco/draconian_stormcaller.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
6 changes: 3 additions & 3 deletions Extra/tilefloor.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ DUNGEON
brick_dark_1_0
grey_dirt0
DEPTHS
brick_dark_1_0
brick_dark_4_0
grey_dirt_b_0
VAULTS
metal_wall0
Expand Down Expand Up @@ -62,8 +62,8 @@ SPIDER NEST
spider00
spider00
ZOT
zot_blue0
tomb0
zot_magenta1
rough_magenta3
FOREST
lair0
grass0
Expand Down
15 changes: 14 additions & 1 deletion FrameGenerator/FileReading/ReadFromFile.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
Expand Down Expand Up @@ -82,6 +83,18 @@ public static Dictionary<string, string> GetMonsterData(string gameLocation)
monster[tokens[1] + tokens[2]] = tokens[0];
}
}

//Fun Overrides for duplicates

var names = new List<string> {"DYELLOW" };

var png = new List<string> { "golden_dragon" };

for (int i = 0; i < names.Count; i++)
{
monster[names.ElementAt(i)] = png.ElementAt(i);
}

return monster;
}
public static Dictionary<string, string[]> Get_Floor_And_Wall_Names_For_Dungeons()
Expand Down
65 changes: 45 additions & 20 deletions FrameGenerator/FrameCreation/CreatingFrame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.Linq;

namespace FrameGenerator.FrameCreation
{
Expand Down Expand Up @@ -156,12 +157,16 @@ private static Bitmap DrawNormal(

private static void DrawMonsterDisplay(Graphics g, Model model, Dictionary<string, Bitmap> monsterPNG, Dictionary<string, string> monsterdata)
{
var black = ColorList.GetColor("BLACK");
var yellow = ColorList.GetColor("YELLOW");
var brown = ColorList.GetColor("BROWN");
var sideOfTilesX = 32 * model.LineLength; var currentLineY = 300;
foreach (var monsterlist in model.MonsterData)
{
var x = sideOfTilesX;
if (!monsterlist.empty)
{

foreach (var monster in monsterlist.MonsterDisplay)//draw all monsters in 1 line
{
if (monsterdata.TryGetValue(monster, out var tileName))
Expand All @@ -173,6 +178,23 @@ private static void DrawMonsterDisplay(Graphics g, Model model, Dictionary<strin
}
}
}
var otherx = x;
foreach (var backgroundColor in monsterlist.MonsterBackground.Skip(monsterlist.MonsterDisplay.Length))
{
var color = ColorList.GetColor(backgroundColor);
if (color != black)
{
if (color.ToArgb() == brown.ToArgb())
{
color = yellow;
}
Bitmap backgroundColorbmp = new Bitmap(12, 16);
Graphics.FromImage(backgroundColorbmp).Clear(color);
g.DrawImage(backgroundColorbmp, otherx, currentLineY + 4);
}
otherx += 12;
}

foreach (var coloredCharacter in monsterlist.MonsterText)//write all text in 1 line
{
var Color = model.ColorList.GetType().GetField(coloredCharacter.Substring(1)).GetValue(model.ColorList);
Expand Down Expand Up @@ -281,13 +303,13 @@ public static void DrawSideDATA(Graphics g, Model model, int prevHP)
temp.Clear(Color.Green);
var x = 32 * (model.LineLength + 8);
g.DrawImage(healthbar, x, 40);
if (barLength != 250 && prevHP - model.SideData.Health > 0)
{
int prevBarLength = (int)(250 * ((float)(prevHP - model.SideData.Health) / model.SideData.Health));
Bitmap losthealthbar = new Bitmap(prevBarLength, 16);
Graphics.FromImage(losthealthbar).Clear(Color.Red);
g.DrawImage(losthealthbar, x + barLength, 40);
}
//if (barLength != 250 && prevHP - model.SideData.Health > 0)
//{
// int prevBarLength = (int)(250 * ((float)(prevHP - model.SideData.Health) / model.SideData.Health));
// Bitmap losthealthbar = new Bitmap(prevBarLength, 16);
// Graphics.FromImage(losthealthbar).Clear(Color.Red);
// g.DrawImage(losthealthbar, x + barLength, 40);
//}

}
if (model.SideData.Magic > 0)
Expand Down Expand Up @@ -486,6 +508,21 @@ public static void DrawTiles(float x, float y, int j,float resize, Graphics g, M
}
}
}
else if (!model.MonsterData[0].empty && model.MonsterData[0].MonsterTextRaw.Contains("catob") ||
!model.MonsterData[1].empty && model.MonsterData[1].MonsterTextRaw.Contains("catob") ||
!model.MonsterData[2].empty && model.MonsterData[2].MonsterTextRaw.Contains("catob") ||
!model.MonsterData[3].empty && model.MonsterData[3].MonsterTextRaw.Contains("catob"))
{
if (tile.Equals("§WHITE"))
{
if (effects.TryGetValue("cloud_calc_dust2", out Bitmap bmp))
{
g.DrawImage(bmp, x, y, bmp.Width * resize, bmp.Height * resize);
drawn = true;
}

}
}
else if (model.SideData.Place.Contains("Shoal"))
{
var colors = new List<string>() { Enum.GetName(typeof(ColorList2), ColorList2.DARKGREY) };
Expand All @@ -504,18 +541,6 @@ public static void DrawTiles(float x, float y, int j,float resize, Graphics g, M
}
}
}
else if (model.SideData.Place.Contains("Dung") || model.SideData.Place.Contains("Lair"))
{
if (tile[0].Equals("§WHITE"))
{
if (effects.TryGetValue("cloud_calc_dust2", out Bitmap bmp))
{
g.DrawImage(bmp, x, y, bmp.Width * resize, bmp.Height * resize);
drawn = true;
}

}
}
else if (model.SideData.Place.Contains("Pand"))//TODO: CHeck For holy enemies?
{
if (tile[0].Equals("§WHITE"))
Expand Down Expand Up @@ -594,7 +619,7 @@ public static void DrawTiles(float x, float y, int j,float resize, Graphics g, M
dict.Add(tile, "");
}
var Color = model.ColorList.GetType().GetField(tile.Substring(1)).GetValue(model.ColorList);
g.DrawString(tile[0] + "?", new Font("Courier New", 16), (SolidBrush)Color, x, y);
g.DrawString(tile[0].ToString() , new Font("Courier New", 16), (SolidBrush)Color, x, y);
}


Expand Down
2 changes: 1 addition & 1 deletion FrameGenerator/FrameGenerator.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net35</TargetFramework>
<TargetFramework>net40</TargetFramework>
<Configurations>Debug;Release;PuttyDllDebug</Configurations>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion InputParse/InputParse.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>InputParse</RootNamespace>
<AssemblyName>InputParse</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
Expand Down
43 changes: 43 additions & 0 deletions InputParse/Model.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,49 @@ public class ColorList
public SolidBrush LIGHTCYAN = new SolidBrush(Color.FromArgb(64, 255, 255));
public SolidBrush WHITE = new SolidBrush(Color.FromArgb(255, 255, 255));
public SolidBrush WHITE2 = new SolidBrush(Color.FromArgb(255, 255, 255));

public static Color GetColor(string name)
{
switch (name)
{
case "BLACK" :
return Color.FromArgb(0, 0, 0);
case "RED" :
return Color.FromArgb(255, 0, 0);
case "GREEN":
return Color.FromArgb(0, 255, 0);
case "BROWN":
return Color.FromArgb(165, 91, 0);
case "BLUE":
return Color.FromArgb(0, 64, 255);
case "MAGENTA":
return Color.FromArgb(192, 0, 255);
case "CYAN":
return Color.FromArgb(0, 255, 255);
case "LIGHTGREY":
return Color.FromArgb(192, 192, 192);
case "DARKGREY":
return Color.FromArgb(128, 128, 128);
case "LIGHTRED":
return Color.FromArgb(255, 128, 128);
case "LIGHTGREEN":
return Color.FromArgb(128, 255, 128);
case "YELLOW":
return Color.FromArgb(255, 255, 0);
case "LIGHTBLUE":
return Color.FromArgb(128, 128, 255);
case "LIGHTMAGENTA":
return Color.FromArgb(255, 128, 255);
case "LIGHTCYAN":
return Color.FromArgb(64, 255, 255);
case "WHITE":
return Color.FromArgb(255, 255, 255);
default: throw new ArgumentException("No Color like that is defined");
}
}
}


public class Model
{
public LayoutType Layout { get; set; } = LayoutType.Normal;
Expand All @@ -73,6 +115,7 @@ public class MonsterData {
public string[] MonsterText { get; set; }//{" LIGHTGRAY, jYELLOW" ...}
public string MonsterTextRaw { get; set; }// jackal
public string[] MonsterDisplay { get; set; }//{"jYELLOW",....}
public string[] MonsterBackground { get; set; }//{"YELLOW",....}
}
public class SideData
{
Expand Down
30 changes: 24 additions & 6 deletions InputParse/Parser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ private static string GetColoredCharacter(Putty.TerminalCharacter character)
{
return GetCharacter(character) + Enum.GetName(typeof(ColorList2), character.ForegroundPaletteIndex);
}
private static string GetBackgroundColor(Putty.TerminalCharacter character)
{
return Enum.GetName(typeof(ColorList2), character.BackgroundPaletteIndex);
}
public static LayoutType GetLayoutType(Putty.TerminalCharacter[,] characters, out string newlocation)
{
StringBuilder place = new StringBuilder();
Expand Down Expand Up @@ -163,6 +167,10 @@ private static MonsterData[] ParseMonsterDisplay(Putty.TerminalCharacter[,] char
string[] monsterLine2Colored = new string[AlmostFullWidth - GameViewWidth - 4];
string[] monsterLine3Colored = new string[AlmostFullWidth - GameViewWidth - 4];
string[] monsterLine4Colored = new string[AlmostFullWidth - GameViewWidth - 4];
string[] monsterLine1Background = new string[AlmostFullWidth - GameViewWidth - 4];
string[] monsterLine2Background = new string[AlmostFullWidth - GameViewWidth - 4];
string[] monsterLine3Background = new string[AlmostFullWidth - GameViewWidth - 4];
string[] monsterLine4Background = new string[AlmostFullWidth - GameViewWidth - 4];
int currentChar = 0;
for (int i = GameViewWidth + 4; i < AlmostFullWidth; i++, currentChar++)
{
Expand All @@ -174,24 +182,34 @@ private static MonsterData[] ParseMonsterDisplay(Putty.TerminalCharacter[,] char
monsterLine2Colored[currentChar] = GetColoredCharacter(characters[i, 14]);
monsterLine3Colored[currentChar] = GetColoredCharacter(characters[i, 15]);
monsterLine4Colored[currentChar] = GetColoredCharacter(characters[i, 16]);
monsterLine1Background[currentChar] = GetBackgroundColor(characters[i, 13]);
monsterLine2Background[currentChar] = GetBackgroundColor(characters[i, 14]);
monsterLine3Background[currentChar] = GetBackgroundColor(characters[i, 15]);
monsterLine4Background[currentChar] = GetBackgroundColor(characters[i, 16]);
}

return new MonsterData[4] {
FormatMonsterData(monsterLine1.ToString(), monsterLine1Colored),
FormatMonsterData(monsterLine2.ToString(), monsterLine2Colored),
FormatMonsterData(monsterLine3.ToString(), monsterLine3Colored),
FormatMonsterData(monsterLine4.ToString(), monsterLine4Colored) };
FormatMonsterData(monsterLine1.ToString(), monsterLine1Colored, monsterLine1Background),
FormatMonsterData(monsterLine2.ToString(), monsterLine2Colored, monsterLine2Background),
FormatMonsterData(monsterLine3.ToString(), monsterLine3Colored, monsterLine3Background),
FormatMonsterData(monsterLine4.ToString(), monsterLine4Colored, monsterLine4Background) };
}

private static MonsterData FormatMonsterData(string monsterLine, string[] monsterLineColored)
private static MonsterData FormatMonsterData(string monsterLine, string[] monsterLineColored, string[] monsterBackgroundColors)
{
if (monsterLine[0].Equals(' '))
{
return new MonsterData();
}
var chars = new char[] { ' ' };
var split = monsterLine.ToString().Split(chars, count: 2);
return new MonsterData() { empty = false, MonsterTextRaw = split[1], MonsterDisplay = monsterLineColored.Take(split[0].Length).ToArray(), MonsterText = monsterLineColored.Skip(split[0].Length).ToArray() };
return new MonsterData() {
empty = false,
MonsterTextRaw = split[1],
MonsterDisplay = monsterLineColored.Take(split[0].Length).ToArray(),
MonsterText = monsterLineColored.Skip(split[0].Length).ToArray(),
MonsterBackground = monsterBackgroundColors
};
}

private static Model parseMapLayout(Putty.TerminalCharacter[,] characters, string location)
Expand Down
2 changes: 1 addition & 1 deletion PuttySharp/PuttySharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Putty</RootNamespace>
<AssemblyName>PuttySharp</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion ShinyConsole/ShinyConsole.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ShinyConsole</RootNamespace>
<AssemblyName>ShinyConsole</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<StartupObject>
</StartupObject>
Expand Down
2 changes: 1 addition & 1 deletion ShinyConsole/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="SlimDX" version="4.0.13.44" targetFramework="net35" />
<package id="SlimDX" version="4.0.13.44" targetFramework="net35" requireReinstallation="true" />
</packages>
Loading

0 comments on commit 8dff75b

Please sign in to comment.