Skip to content

Commit

Permalink
Merge pull request #111 from sunforest99/master
Browse files Browse the repository at this point in the history
[수정] 일꾼이 건설중일때 다른 행동 가능한 버그 수정 타일 UI 안뜨는 버그 수정
  • Loading branch information
sunforest99 authored May 5, 2021
2 parents a65e16c + 0db7bc0 commit 6419300
Show file tree
Hide file tree
Showing 16 changed files with 387 additions and 64 deletions.
2 changes: 1 addition & 1 deletion Assets/Lomenu UI/Materials/Dissolve/Hexart_DECG.mat
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Material:
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _Progress: -0.0054912344
- _Progress: -0.0058515226
- _RangeIn: 0.034
- _RangeOut: 0.001
- _SmoothnessTextureChannel: 0
Expand Down
98 changes: 49 additions & 49 deletions Assets/Resources/mapinfo.txt
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
NNNNMMM1110000000000000000000000000200222222222222
NNNMM111B000000000003300300000000002222022222C2200
NNNMM111110000003333333333300000000002222220200200
MMMMM1111100000033I333I330000000002222000000022222
MMMMM111111000033333300033000002202200000000002000
MMMM1111110003333303000333000000003020000020000220
1MMM11B1100000330000300033000333000300220020000022
11111111100000000003000033333303000322220002200222
1111111000000A000000000000003D330000022C2002222200
11111000000000033330000000000300000002222222202000
00101000000033333033000300000300000000002222222200
00000000003000000003033330003003333300000030000000
00000000030003000003330000003330000033000030000000
0011000003003300033D300000003300000003000300000000
02222200033030333300300003330000033333311111330000
2222220033330000000000000333000033333013M111330000
2222C22003300000000000000000000033300331MNNN110MMM
2222220000000000000100000000A00033300001NNNN1MMMMM
0002200000000000001111101111000033333101MNNNMMMMMM
0000000030000000111112211110000000033131MMMMMMMMM0
0000010033300A001111222221110010000333331111111100
000001003300000112222MM222111010000003333001111111
00000011333300000122MMMMM2221101000333303000100010
0000111300000000122MMMMMMM222211000303033000000000
0000111100003300112MMMNNMMMM2211100130033000000000
0000110130033000122MMNNNNMM22111000030330000000000
00000011130330000122MNNNMMMM221B100000030000000000
000001100000000111222MMMMMM22211100000000000000000
000000113003000111111222222C2211100000000033000000
00110000033000011111112222221100000011003303000000
00101000300000000110011111B11110000010330030300000
11111000300030000100111111111000000311110003300000
01011100303333000000000000110000033011011300030000
011B100033000300000000A000000000300101B10300330000
00111000003300000000000000000000030011113033330000
00010000000000033333000000001000033300030330300000
NNNNMMM1110000000000000000000E00000222222IIIIII222
NNNMM111000000000000K300300000000002222C2IIII02J00
NNNMM111G10000003333333333K0000E00000022222EFEE200
MMMMM111110E0000333333K3300A00000022220000EEE22222
MMMMM11G111000033L3K3000330000022022000FF000EE2000
MMMM11111100033333030003K30000000030200F0020000J20
1MMM11B11000003300003000330003330003002JE0200000J2
11111G11100000000E030E0033333L33000322JJ000220022I
1111H11000000E0000000000000030330000022JJ002222200
1G1110000000000333300A00000003000E00022JJ22C2C2000
00100000000033333033000300E00300000000002222222I00
0000000000300000E003033330003003333300000030000000
0000000E030003000003L30000003330000033000030000000
0011000003003300033030000000330E00000K000300000000
02122200033030333300300E03330000033333311111330000
222222003L33000000000000033300003D333DH3M1G1330000
22J2CI200330000000000E00000000E033300331MNNNG10MMM
222222000000F000001111H111G000003K300001NNNN1MMMMM
000J200000E00000001111111111100033333101MNNNMMMMMM
000000F030000000111G12211HH1100000033131MMMMMMMMM0
0000010033300E00G11122222HHH111000033333G111111G00
000001000300000112222MM222HH111000000L33300G11111G
00E000G13K3300000122MMMMMI2211110A0333303000100010
000011130000000012IMMMMMMM222211000303033000000000
00001G1100003300112MMMNNMMMM221G10013003300000F000
0F00H1B130033000122MMNNNNMM22111000030300000000000
0000001113033000A122MNNNMMMM221110000003000A000000
000001G0000000011122IMMMMMM22211G0E00000E000001000
0000001130030EE11G111222222CI211100000000033000000
001100000330EEE11111112222221100000011003303000000
001B10F030000EEEE110011G11B111100E0011330030300000
11111F0030003EEEE10A111111G1100F000311EG0003300000
01001100303333EEEE0000000011000003301GME1300030000
0110G000330003EEEE000000000000E0300111H10300330000
001G10000033000000000000000000E0030011113033330000
000100E000000003333300E000001000033300030330300000
00000000033330330000330000111000000000033333000000
00000000M30000300000030001101133000000000030000000
00000000000M00033000000100111100333333333300000000
0000000MMM0031100001000110010003300000000000000000
0000003MNNNNMM333110003310000000003303300000000000
0000000MNNNNMM103001000033000000330000300000000000
033003000000MMM00003333003333303300330030000000000
300033MMMMM0M3333300330030030333333033030000000000
33000000MMM33333333333330300333003333D33000A000000
3333300003MMM00000033D3303030033303033300000000000
30333333033303000000003330330333303330000000000000
3333D333333330000000000030000030030000000000000000
00333333300300003333333300000000000000000000000000
0000000000003333333333000000A00000000000000000000A
E0000000M300EA3000000300011B1133000000000030000000
00000000000M000330E0000100111100333333333300EEEE00
E000000MMM00311000010001100100033000000000EEEEEE00
0000003MNNNNMM3331100033100000E00033033000EFFFFEEE
0000EEEMNNNNMM10300100003300000033000030EEFFFFEEE0
0330E3EEEEEEMMM00003333003333303300330030EFFFEEEEE
300E33MMMMMEM33L330033003333333333333303EFFEEF0000
330EEEEEMMM3333333333D33033K303333L333330EFEFF0000
33333EEEE3MMM000000L33K30333003D33333K300000000000
3D333333E333E3000E00003330330333333330000000000000
3333D333333330000000000030000030030000000000A00000
0033333330030F0033333333000F0000000000000000000000
000000000E0033333333330000000000000000000000000000
12 changes: 11 additions & 1 deletion Assets/Scenes/InGame.unity
Original file line number Diff line number Diff line change
Expand Up @@ -7961,7 +7961,7 @@ MonoBehaviour:
- {fileID: 21300000, guid: 6bee12329789d06498d9efbf43125a38, type: 3}
- {fileID: 21300000, guid: f532883756b6f1a47982416a36437fc2, type: 3}
- {fileID: 21300000, guid: f89d12bd18db68f46ac146795493daad, type: 3}
- {fileID: 21300000, guid: 2a9a942a3dc771241a81022e8bfc1f7b, type: 3}
- {fileID: 21300000, guid: b93c9fbba8889e5419c26ddb2a6316eb, type: 3}
- {fileID: 21300000, guid: b422a68ac9d967f4ba3d06d7707e3892, type: 3}
- {fileID: 21300000, guid: 48853b64a25bd0b4ca3bb19260c643af, type: 3}
- {fileID: 21300000, guid: b08e570699f1c8a4f9cc388204aef3bc, type: 3}
Expand All @@ -7982,6 +7982,16 @@ MonoBehaviour:
- {fileID: 21300014, guid: e48ddf4fb7304ce4ab48711eb6617a57, type: 3}
- {fileID: 21300102, guid: e48ddf4fb7304ce4ab48711eb6617a57, type: 3}
- {fileID: 21300104, guid: e48ddf4fb7304ce4ab48711eb6617a57, type: 3}
- {fileID: 21300000, guid: ce44b67118439c145aa68bbeecf92d7a, type: 3}
- {fileID: 21300000, guid: 589ad35d2372fc24a8cb804d15c6f87f, type: 3}
- {fileID: 21300000, guid: 7df0c622fc0fc3a4f8b44340018c9ad0, type: 3}
- {fileID: 21300000, guid: 51564a1d82ed53b4da8c6568136a951c, type: 3}
- {fileID: 21300000, guid: e3aa99260b442b14087a2eeb08ac0306, type: 3}
- {fileID: 21300000, guid: a92c6ecca99317b43a9c42907227c12e, type: 3}
- {fileID: 21300000, guid: f22b932707676a54faf6433035a2ec93, type: 3}
- {fileID: 21300000, guid: b284e4999e5db844283cbdcfba1aad8a, type: 3}
- {fileID: 21300000, guid: 31eb0f45182afb94bb64af2722a58cbf, type: 3}
- {fileID: 21300000, guid: 3c9fe331726228e4fb20fc69d80ef001, type: 3}
mainBarObj: {fileID: 1183078789144197330}
loseUI: {fileID: 2110199068}
winUI: {fileID: 1514986757}
Expand Down
3 changes: 2 additions & 1 deletion Assets/Scripts/Manager/Enum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ public enum TILE
STONE_DECO2 = 'L',
SEA_01 = 'M',
SEA_02 = 'N',
SEA_03 = 'O'
SEA_03 = 'O',
MARS = -1
}

/*
Expand Down
26 changes: 21 additions & 5 deletions Assets/Scripts/Manager/GameMng.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class GameMng : MonoBehaviour
*/
[HideInInspector]
public int _gold = 0;
[HideInInspector]
[SerializeField]
public int _food = 0;
[HideInInspector]
public int _nowMem = 0;
Expand Down Expand Up @@ -219,7 +219,7 @@ void Start()
public void init()
{
_gold = 100;
_food = 100;
_food = 0;
_nowMem = 0;
_maxMem = 0;

Expand Down Expand Up @@ -438,7 +438,7 @@ public void turnManage(int uniqueNumber)
}
else
{
countHungry = 0;
countHungry = -1;
//debuffImg.enabled = false;
debuffImg.color = Color.clear;
debufFoodIcon.SetActive(false);
Expand Down Expand Up @@ -1335,9 +1335,9 @@ public Sprite getObjSprite(int code)
case (int)TILE.SEA_01:
return objSprite[9];
case (int)TILE.SEA_02:
return objSprite[9];
return objSprite[38];
case (int)TILE.SEA_03:
return objSprite[9];
return objSprite[39];
case (int)UNIT.FOREST_WORKER:
return objSprite[12];
case (int)UNIT.FOREST_SOLDIER_0:
Expand Down Expand Up @@ -1374,6 +1374,22 @@ public Sprite getObjSprite(int code)
return objSprite[28];
case (int)UNIT.DESERT_WITCH_1:
return objSprite[29];
case (int)TILE.GRASS_TREE:
return objSprite[30];
case (int)TILE.GRASS_STONE:
return objSprite[31];
case (int)TILE.SAND_TREE:
return objSprite[32];
case (int)TILE.SAND_STONE:
return objSprite[33];
case (int)TILE.DIRT_TREE:
return objSprite[34];
case (int)TILE.DIRT_STONE:
return objSprite[35];
case (int)TILE.STONE_DECO1:
return objSprite[36];
case (int)TILE.STONE_DECO2:
return objSprite[37];
case (int)BUILT.MINE:
setMainInterface(true, false);
return objSprite[0];
Expand Down
1 change: 1 addition & 0 deletions Assets/Scripts/Manager/UnitMng.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ public void Building(int cost, int index, int unitindex)
if (GameMng.I._gold >= cost)
{
GameMng.I.selectedTile._unitObj._bActAccess = false;
Debug.Log("1" + GameMng.I.selectedTile._unitObj._bActAccess + "unit " + GameMng.I.selectedTile._unitObj);

GameObject Child = Instantiate(builtObj[index - 200], GameMng.I.targetTile.transform) as GameObject;
GameMng.I.targetTile._builtObj = Child.GetComponent<Built>();
Expand Down
6 changes: 3 additions & 3 deletions Assets/Scripts/Tile/Tile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ void Start()
{
tile = this.GetComponent<GameObject>();

if (this.tileuniquecode >= (int)TILE.GRASS_TREE) { this.tileSpriteRend.sprite = tiledecoSprite[this.tileuniquecode - (int)TILE.GRASS_TREE]; }
else if (this._code >= (int)TILE.GRASS_START && this._code < (int)TILE.GRASS_TREE) { this.tileSpriteRend.sprite = tileSprite[this._code - (int)TILE.GRASS_START]; }
else if (this._code < (int)TILE.CAN_MOVE) { this.tileSpriteRend.sprite = tileSprite[this._code]; }
if (this.tileuniquecode >= (int)TILE.GRASS_START && this.tileuniquecode < (int)TILE.GRASS_TREE) { this.tileSpriteRend.sprite = tileSprite[this.tileuniquecode - (int)TILE.GRASS_START]; }
else if (this.tileuniquecode >= (int)TILE.GRASS_TREE) { this.tileSpriteRend.sprite = tiledecoSprite[this.tileuniquecode - (int)TILE.GRASS_TREE]; }
else if (this.tileuniquecode < (int)TILE.CAN_MOVE) { this.tileSpriteRend.sprite = tileSprite[this._code]; }

_name = "독도는";
_desc = "우리땅";
Expand Down
10 changes: 8 additions & 2 deletions Assets/Scripts/Unit/Unit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public class Unit : DynamicObject

public string _unitDesc; // 유닛 생성 시 나오는 설명

public bool _actdebuff = false;

/**
* @brief 유닛 생성 대기 및 생성 함수
*/
Expand Down Expand Up @@ -63,13 +65,14 @@ public void maintenance()
NetworkMng.getInstance.SendMsg(string.Format("DIE_UNIT:{0}:{1}", PosX, PosZ));
}
}
else if (GameMng.I.countHungry > (NetworkMng.getInstance.v_user.Count * 6))
else if (GameMng.I.countHungry > (NetworkMng.getInstance.v_user.Count * 6) && !_actdebuff)
{
// 랜덤 행동불능 (확률 %)
int percent = Random.Range(1, 100);
if (percent > 80)
{
_bActAccess = false;
_actdebuff = true;
}
}
else if (GameMng.I.countHungry > (NetworkMng.getInstance.v_user.Count * 3))
Expand All @@ -78,8 +81,11 @@ public void maintenance()
_hp -= 1;
}

if (GameMng.I.countHungry >= 0)
if (GameMng.I.countHungry < 0 && _actdebuff)
{
_bActAccess = true;
_actdebuff = false;
}

if (_hp < 1)
{
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
96 changes: 96 additions & 0 deletions Assets/Sprites/hexagon-pack/PNG/Tiles/Sea/ui_sea_00.png.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 6419300

Please sign in to comment.