Commit fca7e4c4 authored by 황호기's avatar 황호기

화면보호기 진짜 완성, 캐릭터 에디터 시작

parent 6cedfbf4
This diff is collapsed.
fileFormatVersion: 2
guid: cca2edc14b5603345af73e23aca43c1d
folderAsset: yes
guid: c3966f6ce6bf0db47afe315a4e66544a
DefaultImporter:
externalObjects: {}
userData:
......
This diff is collapsed.
......@@ -24,6 +24,10 @@ public class GameLogic : MonoBehaviour {
private Text turnText;
[SerializeField]
private GameoverUI gameoverUI;
[SerializeField]
private Image[] powerImages;
[SerializeField]
private Text[] powerTexts;
private int turn;
private int firstTurnParty;
private int currentTurnParty;
......@@ -68,7 +72,7 @@ public class GameLogic : MonoBehaviour {
if ( dataLogic.Parties[ currentTurnParty ].LeaderAlive )
yield return SetLeaderCard();
yield return UseSkill();
dataLogic.CalcAndAssignBonus();
ShowResult( dataLogic.CalcAndAssignBonus() );
yield return Action();
AssignDataAndResetCard();
if ( CheckGameOver() )
......@@ -109,7 +113,13 @@ public class GameLogic : MonoBehaviour {
yield return characters[ currentTurnParty, i ].UseSkill();
}
}
public void ShowResult(string result)
{
powerImages[ currentTurnParty ].gameObject.SetActive( true );
powerTexts[ currentTurnParty ].text = result;
}
public IEnumerator Action()
{
dataLogic.Action();
......@@ -123,6 +133,7 @@ public class GameLogic : MonoBehaviour {
public void AssignDataAndResetCard()
{
powerImages[ currentTurnParty ].gameObject.SetActive( false );
for ( int p = 0; p < 2; p++ )
{
for ( int i = 0; i < 5; i++ )
......
......@@ -12,6 +12,7 @@ namespace TBR.Data
private const int twopairBonus = 5;
public static string CalcAndAssignBonus(Character[] characters )
{
string result = "";
CardData[] cardData = new CardData[ 5 ];
for ( int i = 0; i < 5; i++ )
{
......@@ -23,7 +24,10 @@ namespace TBR.Data
if ( cardData[ 0 ] != null && cardData[ 1 ] != null && cardData[ 2 ] != null && cardData[ 3 ] != null && cardData[ 4 ] != null )
if ( cardData[ 0 ].Element == cardData[ 1 ].Element && cardData[ 1 ].Element == cardData[ 2 ].Element
&& cardData[ 2 ].Element == cardData[ 3 ].Element && cardData[ 3 ].Element == cardData[ 4 ].Element )
{
result = "FLUSH!";
powerBonus = new int[ 5 ] { 2, 2, 2, 2, 2 };
}
List<int> numberCounts = new List<int> { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
List<int> pairTable = new List<int>( pairBonus );
foreach ( var c in cardData )
......@@ -31,26 +35,51 @@ namespace TBR.Data
if ( c != null )
numberCounts[ c.Number - 1 ]++;
}
if ( numberCounts.Contains( 3 ) && numberCounts.Contains( 2 ) )
if ( numberCounts.Contains( 5 ) )
{
result = "FIVE CARD" + result;
}
else if ( numberCounts.Contains( 4 ) )
{
result = "FOUR CARD" + result;
}
else if ( numberCounts.Contains( 3 ) && numberCounts.Contains( 2 ) )
{
result = "FULL HOUSE" + result;
pairTable[ 1 ] = fullhouseBonus;
pairTable[ 2 ] = fullhouseBonus;
}
else if ( numberCounts.Count(c=>c==1)==5 )
else if ( numberCounts.Count( c => c == 1 ) == 5 )
{
var firstNum = numberCounts.IndexOf( 1 );
if ( numberCounts[ firstNum ] == 1 && numberCounts[ firstNum + 1 ] == 1 && numberCounts[ firstNum + 2 ] == 1 && numberCounts[ firstNum + 3 ] == 1 && numberCounts[ firstNum + 4 ] == 1 )
{
result = "STRAIGHT" + result;
pairTable[ 0 ] = straightBonus;
}
else if( result != "FLUSH!" )
result = "NO PAIR...";
}
else if ( numberCounts.Contains( 3 ) )
{
result = "TRIPLE" + result;
}
else if ( numberCounts.Count( c => c == 2 ) == 2 )
{
result = "TWO PAIRS" + result;
pairTable[ 1 ] = twopairBonus;
}
else if ( numberCounts.Contains( 2 ) )
{
result = "ONE PAIR" + result;
}
else if ( result != "FLUSH!" )
result = "NO PAIR...";
for ( int i = 0; i < 5; i++ )
{
if ( cardData[ i ] != null )
{
powerBonus[ i ] *= pairTable[ numberCounts[ cardData[ i ].Number -1 ] ];
powerBonus[ i ] *= pairTable[ numberCounts[ cardData[ i ].Number -1 ] - 1 ];
}
}
......@@ -78,7 +107,7 @@ namespace TBR.Data
if ( characters[ i ] != null && characters[ i ].IsLive )
characters[ i ].SetBonus( powerBonus[ i ], countBonus[ i ] );
}
return "";
return result;
}
public static List<Character> GetTargetChatacters(Character[] characters, List<int> targets)
......
......@@ -39,12 +39,12 @@ namespace TBR.Data
//임시 코드(HSymbol)
public void Randomize()
{
HP = Random.Range( 30000, 60000 );
Sword = Random.Range( 100, 200 );
Gun = Random.Range( 100, 200 );
Mana = Random.Range( 100, 200 );
Shield = Random.Range( 300, 600 );
Heal = Random.Range( 300, 600 );
HP = Random.Range( 15000, 45000 );
Sword = Random.Range( 10, 300 );
Gun = Random.Range( 10, 300 );
Mana = Random.Range( 10, 300 );
Shield = Random.Range( 30, 900 );
Heal = Random.Range( 30, 900 );
CardCases = new CardCase[ 10 ];
for ( int i = 0; i < 10; i++ )
CardCases[ i ] = new CardCase();
......
......@@ -44,9 +44,9 @@ namespace TBR.Game
Parties[ currentTurnParty ].UseSkill();
}
public void CalcAndAssignBonus()
public string CalcAndAssignBonus()
{
Parties[ currentTurnParty ].CalcAndAssignBonus();
return Parties[ currentTurnParty ].CalcAndAssignBonus();
}
public void Action()
......@@ -99,7 +99,7 @@ namespace TBR.Game
{
if ( Parties[p].IsCharacterExist(i) )
{
scores[ p ] += 200 + Parties[ p ].Characters[ i ].HP * 100 / Parties[ p ].Characters[ i ].MaxHP;
scores[ p ] += 1000 + Parties[ p ].Characters[ i ].HP * 100 / Parties[ p ].Characters[ i ].MaxHP;
}
}
}
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;
namespace TBR.TableData
{
public class CharacterDescriptor
{
[JsonProperty]
public string Id { get; private set; }
[JsonProperty]
public int MaxLevel { get; private set; }
[JsonProperty]
public int MinHP { get; private set; }
[JsonProperty]
public int MaxHP { get; private set; }
[JsonProperty]
public ElementDesctiptor[] ElementPowers { get; private set; }
[JsonProperty]
public CardCaseDesctiptor[] CardCases { get; private set; }
[JsonProperty]
public string LeaderSkillId { get; private set; }
}
public class ElementDesctiptor
{
[JsonProperty]
public int Min { get; private set; }
[JsonProperty]
public int Max { get; private set; }
[JsonProperty]
public List<string> ActionPool { get; private set; }
}
public class CardCaseDesctiptor
{
[JsonProperty]
public bool[] ElementCond { get; private set; }
[JsonProperty]
public bool[] NumberCond { get; private set; }
[JsonProperty]
public string SkillId { get; private set; }
}
}
fileFormatVersion: 2
guid: a7e394cddcf31f847b1778f716cf4c0d
folderAsset: yes
DefaultImporter:
guid: b7faedc89434b2649b5f6c84b4270241
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 400a4e7d723400b4b8fab76f8a1c2fda
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 7
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: ef2f2e4608b7dbe4a95f7f08c4748883
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment