Browse Source

0919锻造修理

pull/197/head
软件204张景程 3 months ago
parent
commit
722c41e11b
  1. 135
      ColorlessWorld-2024-4-2/Assets/GameDate/LevelDate/LevelState_1.asset
  2. 2
      ColorlessWorld-2024-4-2/Assets/GameDate/cardDeckList.asset
  3. 27
      ColorlessWorld-2024-4-2/Assets/Plugins/Microsoft.CSharp.dll.meta
  4. 1
      ColorlessWorld-2024-4-2/Assets/Scenes/StartMainScence.unity
  5. 41
      ColorlessWorld-2024-4-2/Assets/Scripts/ForgingPoint/ForgintPointManager.cs
  6. 2
      ColorlessWorld-2024-4-2/Assets/Scripts/Item/BlockNode/BlockNode.cs
  7. 8
      ColorlessWorld-2024-4-2/Assets/Scripts/Item/TakerOverNode/ItemTakerOverNode.cs
  8. 110
      ColorlessWorld-2024-4-2/Assets/Scripts/LeveProcess/LeveGeneraterNew.cs
  9. 44
      ColorlessWorld-2024-4-2/Assets/Scripts/MapUnity.cs
  10. 4
      ColorlessWorld-2024-4-2/Assets/Scripts/Weapon/WeaponManager.cs

135
ColorlessWorld-2024-4-2/Assets/GameDate/LevelDate/LevelState_1.asset

@ -12,9 +12,9 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 23280c7f867c4ca468ab73909d4f7707, type: 3}
m_Name: LevelState_1
m_EditorClassIdentifier:
levelStep: 7
levelStep: 1
mapLevel: 1
currentPoint: {x: 6, y: 2}
currentPoint: {x: 0, y: 1}
levelSaveMap:
- levelDataList:
- roomType: 13
@ -79,8 +79,8 @@ MonoBehaviour:
nextLevelNodes: []
fightEenemyPool: weak
enemyList:
- RatWarrior
- Pharmacist
- LivingArmor
- FailedSample
extraEnemyList: []
mapIndex: 100001
extraMapIndex:
@ -88,7 +88,7 @@ MonoBehaviour:
- roomType: 0
roomSprite: {fileID: 21300000, guid: b8a209883c3910b4199ecc6bd1beebbd, type: 3}
isUse: 1
passBy: 1
passBy: 0
nodePos: {x: -5.0130577, y: 0.055995107, z: 10}
line: 1
column: 1
@ -119,21 +119,21 @@ MonoBehaviour:
nextLevelNodes: []
fightEenemyPool: weak
enemyList:
- LivingArmor
- FailedSample
- RatWarrior
- Pharmacist
extraEnemyList: []
mapIndex: 100001
extraMapIndex:
isExtra: 0
- levelDataList:
- roomType: 10
roomSprite: {fileID: 21300000, guid: 4bba0a3acc15faf4a8b904c7c0a781e2, type: 3}
- roomType: 11
roomSprite: {fileID: 21300000, guid: 5edbcfc45fbb4b2428e4f2782201afad, type: 3}
isUse: 1
passBy: 1
passBy: 0
nodePos: {x: -3.709052, y: -1.4781291, z: 10}
line: 2
column: 0
roomDestinationIndex: 9
roomDestinationIndex: 11
fatherLevelNodes:
- {x: 1, y: 1}
nextLevelNodes:
@ -144,14 +144,14 @@ MonoBehaviour:
mapIndex:
extraMapIndex:
isExtra: 0
- roomType: 11
roomSprite: {fileID: 21300000, guid: 5edbcfc45fbb4b2428e4f2782201afad, type: 3}
- roomType: 10
roomSprite: {fileID: 21300000, guid: 4bba0a3acc15faf4a8b904c7c0a781e2, type: 3}
isUse: 1
passBy: 0
nodePos: {x: -3.709052, y: 0.055995107, z: 10}
line: 2
column: 1
roomDestinationIndex: 11
roomDestinationIndex: 9
fatherLevelNodes:
- {x: 1, y: 1}
nextLevelNodes:
@ -162,14 +162,14 @@ MonoBehaviour:
mapIndex:
extraMapIndex:
isExtra: 0
- roomType: 4
roomSprite: {fileID: 21300000, guid: e2a576b37ecc9ee4a92a1595d55eeb41, type: 3}
- roomType: 6
roomSprite: {fileID: 21300000, guid: dc3014f38b95b24448577e14bee06967, type: 3}
isUse: 1
passBy: 0
nodePos: {x: -3.709052, y: 1.5901195, z: 10}
line: 2
column: 2
roomDestinationIndex: 5
roomDestinationIndex: 7
fatherLevelNodes:
- {x: 1, y: 1}
nextLevelNodes:
@ -184,7 +184,7 @@ MonoBehaviour:
- roomType: 0
roomSprite: {fileID: 21300000, guid: b8a209883c3910b4199ecc6bd1beebbd, type: 3}
isUse: 1
passBy: 1
passBy: 0
nodePos: {x: -2.4050474, y: -1.4781291, z: 10}
line: 3
column: 0
@ -195,8 +195,8 @@ MonoBehaviour:
- {x: 4, y: 0}
fightEenemyPool: weak
enemyList:
- RatWarrior
- Pharmacist
- LivingArmor
- FailedSample
extraEnemyList: []
mapIndex: 100001
extraMapIndex:
@ -215,8 +215,8 @@ MonoBehaviour:
- {x: 4, y: 1}
fightEenemyPool: weak
enemyList:
- Gravitus
- RatWarrior
- LivingArmor
- FailedSample
extraEnemyList: []
mapIndex: 100001
extraMapIndex:
@ -235,8 +235,8 @@ MonoBehaviour:
- {x: 4, y: 2}
fightEenemyPool: weak
enemyList:
- Gravitus
- RatWarrior
- Pharmacist
extraEnemyList: []
mapIndex: 100001
extraMapIndex:
@ -245,7 +245,7 @@ MonoBehaviour:
- roomType: 4
roomSprite: {fileID: 21300000, guid: e2a576b37ecc9ee4a92a1595d55eeb41, type: 3}
isUse: 1
passBy: 1
passBy: 0
nodePos: {x: -1.1010413, y: -1.4781291, z: 10}
line: 4
column: 0
@ -260,14 +260,14 @@ MonoBehaviour:
mapIndex:
extraMapIndex:
isExtra: 0
- roomType: 6
roomSprite: {fileID: 21300000, guid: dc3014f38b95b24448577e14bee06967, type: 3}
- roomType: 8
roomSprite: {fileID: 21300000, guid: 8c256e576311e0440a140e4be2ec9e51, type: 3}
isUse: 1
passBy: 0
nodePos: {x: -1.1010413, y: 0.055995107, z: 10}
line: 4
column: 1
roomDestinationIndex: 7
roomDestinationIndex: 6
fatherLevelNodes:
- {x: 3, y: 1}
nextLevelNodes:
@ -278,14 +278,14 @@ MonoBehaviour:
mapIndex:
extraMapIndex:
isExtra: 0
- roomType: 11
roomSprite: {fileID: 21300000, guid: 5edbcfc45fbb4b2428e4f2782201afad, type: 3}
- roomType: 15
roomSprite: {fileID: 21300000, guid: 6b27bdf9c297a274f95e945a248a7668, type: 3}
isUse: 1
passBy: 0
nodePos: {x: -1.1010413, y: 1.5901195, z: 10}
line: 4
column: 2
roomDestinationIndex: 11
roomDestinationIndex: 14
fatherLevelNodes:
- {x: 3, y: 2}
nextLevelNodes:
@ -316,7 +316,7 @@ MonoBehaviour:
- roomType: 11
roomSprite: {fileID: 21300000, guid: 5edbcfc45fbb4b2428e4f2782201afad, type: 3}
isUse: 1
passBy: 1
passBy: 0
nodePos: {x: 0.2029643, y: 0.055995107, z: 10}
line: 5
column: 1
@ -371,14 +371,14 @@ MonoBehaviour:
mapIndex:
extraMapIndex:
isExtra: 0
- roomType: 15
roomSprite: {fileID: 21300000, guid: 6b27bdf9c297a274f95e945a248a7668, type: 3}
- roomType: 11
roomSprite: {fileID: 21300000, guid: 5edbcfc45fbb4b2428e4f2782201afad, type: 3}
isUse: 1
passBy: 0
nodePos: {x: 1.5069704, y: 0.055995107, z: 10}
line: 6
column: 1
roomDestinationIndex: 14
roomDestinationIndex: 11
fatherLevelNodes:
- {x: 5, y: 1}
nextLevelNodes:
@ -389,14 +389,14 @@ MonoBehaviour:
mapIndex:
extraMapIndex:
isExtra: 0
- roomType: 6
roomSprite: {fileID: 21300000, guid: dc3014f38b95b24448577e14bee06967, type: 3}
- roomType: 15
roomSprite: {fileID: 21300000, guid: 6b27bdf9c297a274f95e945a248a7668, type: 3}
isUse: 1
passBy: 1
passBy: 0
nodePos: {x: 1.5069704, y: 1.5901195, z: 10}
line: 6
column: 2
roomDestinationIndex: 7
roomDestinationIndex: 14
fatherLevelNodes:
- {x: 5, y: 1}
nextLevelNodes:
@ -422,15 +422,14 @@ MonoBehaviour:
- {x: 8, y: 0}
fightEenemyPool: strong
enemyList:
- RatWarrior
- FailedSample
- Pharmacist
- PollutionSpreader
- Gravitus
extraEnemyList: []
mapIndex: 100001
extraMapIndex:
isExtra: 0
- roomType: 0
roomSprite: {fileID: 21300000, guid: b8a209883c3910b4199ecc6bd1beebbd, type: 3}
- roomType: 1
roomSprite: {fileID: 21300000, guid: f3df96407bf665b4d8cd8f13dfb3d6d0, type: 3}
isUse: 1
passBy: 0
nodePos: {x: 2.810976, y: 0.055995107, z: 10}
@ -441,16 +440,17 @@ MonoBehaviour:
- {x: 6, y: 1}
nextLevelNodes:
- {x: 8, y: 1}
fightEenemyPool: strong
fightEenemyPool: elite
enemyList:
- PollutionSpreader
- Gravitus
- Climavista
- AcidRainCloud
- AcidRainCloud
extraEnemyList: []
mapIndex: 100001
extraMapIndex:
isExtra: 0
- roomType: 1
roomSprite: {fileID: 21300000, guid: f3df96407bf665b4d8cd8f13dfb3d6d0, type: 3}
- roomType: 0
roomSprite: {fileID: 21300000, guid: b8a209883c3910b4199ecc6bd1beebbd, type: 3}
isUse: 1
passBy: 0
nodePos: {x: 2.810976, y: 1.5901195, z: 10}
@ -461,25 +461,23 @@ MonoBehaviour:
- {x: 6, y: 2}
nextLevelNodes:
- {x: 8, y: 2}
fightEenemyPool: elite
fightEenemyPool: strong
enemyList:
- Twinbee
- ReconnaissanceBee
- ReconnaissanceBee
- Thief
- PollutionSpreader
- Gravitus
extraEnemyList: []
mapIndex: 100001
extraMapIndex:
isExtra: 0
- levelDataList:
- roomType: 15
roomSprite: {fileID: 21300000, guid: 6b27bdf9c297a274f95e945a248a7668, type: 3}
- roomType: 8
roomSprite: {fileID: 21300000, guid: 8c256e576311e0440a140e4be2ec9e51, type: 3}
isUse: 1
passBy: 0
nodePos: {x: 4.1149817, y: -1.4781291, z: 10}
line: 8
column: 0
roomDestinationIndex: 14
roomDestinationIndex: 6
fatherLevelNodes:
- {x: 7, y: 0}
nextLevelNodes:
@ -490,14 +488,14 @@ MonoBehaviour:
mapIndex:
extraMapIndex:
isExtra: 0
- roomType: 10
roomSprite: {fileID: 21300000, guid: 4bba0a3acc15faf4a8b904c7c0a781e2, type: 3}
- roomType: 4
roomSprite: {fileID: 21300000, guid: e2a576b37ecc9ee4a92a1595d55eeb41, type: 3}
isUse: 1
passBy: 0
nodePos: {x: 4.1149817, y: 0.055995107, z: 10}
line: 8
column: 1
roomDestinationIndex: 9
roomDestinationIndex: 5
fatherLevelNodes:
- {x: 7, y: 1}
nextLevelNodes:
@ -508,14 +506,14 @@ MonoBehaviour:
mapIndex:
extraMapIndex:
isExtra: 0
- roomType: 8
roomSprite: {fileID: 21300000, guid: 8c256e576311e0440a140e4be2ec9e51, type: 3}
- roomType: 6
roomSprite: {fileID: 21300000, guid: dc3014f38b95b24448577e14bee06967, type: 3}
isUse: 1
passBy: 0
nodePos: {x: 4.1149817, y: 1.5901195, z: 10}
line: 8
column: 2
roomDestinationIndex: 6
roomDestinationIndex: 7
fatherLevelNodes:
- {x: 7, y: 2}
nextLevelNodes:
@ -596,9 +594,8 @@ MonoBehaviour:
- {x: 11, y: 1}
fightEenemyPool: strong
enemyList:
- RatWarrior
- FailedSample
- Pharmacist
- Thief
- PrismReflector
extraEnemyList: []
mapIndex: 100001
extraMapIndex:
@ -617,8 +614,9 @@ MonoBehaviour:
- {x: 11, y: 1}
fightEenemyPool: strong
enemyList:
- Thief
- PrismReflector
- RatWarrior
- FailedSample
- Pharmacist
extraEnemyList: []
mapIndex: 100001
extraMapIndex:
@ -637,8 +635,7 @@ MonoBehaviour:
- {x: 11, y: 1}
fightEenemyPool: strong
enemyList:
- Twinbee
- ReconnaissanceBee
- Thief
- PrismReflector
extraEnemyList: []
mapIndex: 100001

2
ColorlessWorld-2024-4-2/Assets/GameDate/cardDeckList.asset

@ -13,11 +13,11 @@ MonoBehaviour:
m_Name: cardDeckList
m_EditorClassIdentifier:
cardDeckList:
- 1029
- 1030
- 1030
- 1030
- 1030
- 1029
- 1030
- 1030
- 1030

27
ColorlessWorld-2024-4-2/Assets/Plugins/Microsoft.CSharp.dll.meta

@ -1,27 +0,0 @@
fileFormatVersion: 2
guid: a94cf6fef2879da4c91e5ef768aadf4e
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:

1
ColorlessWorld-2024-4-2/Assets/Scenes/StartMainScence.unity

@ -169,6 +169,7 @@ MonoBehaviour:
- {fileID: 11400000, guid: 84a5908e5cd56624db024cd13ede7dce, type: 2}
- {fileID: 11400000, guid: 8e440be4a715c1a43a46642bf23b15c3, type: 2}
- {fileID: 11400000, guid: 9148ff0227daafb47861b3bbb30d33b9, type: 2}
- {fileID: 11400000, guid: 86161342c7eeef94b948eb0e6954bb60, type: 2}
bagForgedMaterialNodeLsit: []
forgedMaterialLoadPath: BagForgerMaterial/
--- !u!4 &1381861

41
ColorlessWorld-2024-4-2/Assets/Scripts/ForgingPoint/ForgintPointManager.cs

@ -3,11 +3,6 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using TMPro;
using Unity.VisualScripting;
using Unity.VisualScripting.Antlr3.Runtime.Collections;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.InputSystem;
@ -283,7 +278,9 @@ public class ForgintPointManager : Singleton<ForgintPointManager>
}
public void GenerateNewCard()
{
CardOriginalData cardData = chooseCardEntity.cardOriginalData;
//序列化复制一份卡牌信息
CardOriginalData cardData = JsonConvert.DeserializeObject<CardOriginalData>(JsonConvert.SerializeObject(chooseCardEntity.cardOriginalData));
// CardOriginalData cardData = chooseCardEntity.cardOriginalData;
foreach (MapUnity choosedMapUnity in forgedMapUnityPool)
{
(int x, int y, int z) = MathTool.GetRelativeCoordinates(choosedMapUnity, startMapUnity);
@ -296,30 +293,45 @@ public class ForgintPointManager : Singleton<ForgintPointManager>
{
if (cardData.nodesMark[i] == ds)
{
cardData.nodesColor[i] = Name.intColorTostring(choosedMapUnity.whoColour);
if (choosedMapUnity.blockNode == null)
{
cardData.nodesColor[i] = Name.intColorTostring(choosedMapUnity.whoColour);
}
else
{
cardData.nodesColor[i] = Name.intColorTostring(choosedMapUnity.whoColour) + "_" + choosedMapUnity.blockNode.nameMark;
}
break;
}
}
}
else//未存在,直接加入
{
List<string> ds = cardData.nodesMark.ToList();
//位置
ds.Add((j + "_" + k));
cardData.nodesMark = ds.ToArray();
//颜色
ds = cardData.nodesColor.ToList();
ds.Add(Name.intColorTostring(choosedMapUnity.whoColour));
string signelNodeColor = Name.intColorTostring(choosedMapUnity.whoColour);
if (choosedMapUnity.blockNode !=null )
{
signelNodeColor= Name.intColorTostring(choosedMapUnity.whoColour) + "_" + choosedMapUnity.blockNode.nameMark;
}
ds.Add(signelNodeColor);
cardData.nodesColor = ds.ToArray();
CoordinateColorPair pair = new CoordinateColorPair(j, k, Name.intColorTostring(choosedMapUnity.whoColour));
//imageMark
CoordinateColorPair pair = new CoordinateColorPair(j, k, signelNodeColor);
cardData.cardImageMark.Add(pair);
}
}
foreach (var color in cardData .nodesColor)
{
Debug.Log("锻造颜色:" + color);
}
//注册卡牌信息
CardOriginalData newCardOriginalData = JsonConvert.DeserializeObject<CardOriginalData>(JsonConvert.SerializeObject(cardData));
string newCardID = chooseCardEntity.cardId + "1";
CardOriginalDataList.Instance.existCardOriginalDataList.Add(newCardID, newCardOriginalData);
string newCardID = CardManager.Instance.createNewCard(cardData);
PlayerStatsManager.Instance.cardDeck.cardDeckList.Remove(chooseCardEntity.CardId);
PlayerStatsManager.Instance.cardDeck.cardDeckList.Add(newCardID);
@ -405,6 +417,7 @@ public class ForgintPointManager : Singleton<ForgintPointManager>
if (nodeDelItem.blockNode != null )
{
DestroyImmediate(nodeDelItem.blockNode.gameObject);
nodeDelItem.blockNode = null;
nodeDelItem.blocked = false;
}

2
ColorlessWorld-2024-4-2/Assets/Scripts/Item/BlockNode/BlockNode.cs

@ -12,7 +12,7 @@ public class BlockNode : MonoBehaviour
public bool isMapChange=false;
public string nameMark;//标识自己的名字,用于生成卡牌数据的nodeColor
public void OnEnable()

8
ColorlessWorld-2024-4-2/Assets/Scripts/Item/TakerOverNode/ItemTakerOverNode.cs

@ -37,8 +37,10 @@ public class ItemTakerOverNode : MonoBehaviour
public void GenerateBlockItem(MapUnity currentNode,GameObject item,int belong)
{
var block = Instantiate(item, currentNode.transform.position, item.transform.rotation);
block .GetComponent <BlockNode >().inMapUnity = currentNode;
block.GetComponent<BlockNode>().belong = belong;
block.GetComponent<BlockNode>().StartResgite();
BlockNode blockNode = block.GetComponent<BlockNode>();
blockNode.inMapUnity = currentNode;
blockNode.belong = belong;
blockNode.nameMark = item.name;
blockNode.StartResgite();
}
}

110
ColorlessWorld-2024-4-2/Assets/Scripts/LeveProcess/LeveGeneraterNew.cs

@ -513,15 +513,15 @@ public class LeveGeneraterNew : Singleton<LeveGeneraterNew>
switch (elitCount)
{
case 1:
int elitLine = Random.Range(1, 3);
int elitLine = Random.Range(2, 4);
int elitColumn = Random.Range(0, 3);
levelMap[fightFloor[elitLine]].levelColumn[elitColumn].SetUpRoom(RoomType.eliteMonster);
break;
case 2:
int elitColumn_1 = Random.Range(0, 3);
int elitColumn_2 = Random.Range(0, 3);
levelMap[fightFloor[1]].levelColumn[elitColumn_1].SetUpRoom(RoomType.eliteMonster);
levelMap[fightFloor[2]].levelColumn[elitColumn_2].SetUpRoom(RoomType.eliteMonster);
levelMap[fightFloor[2]].levelColumn[elitColumn_1].SetUpRoom(RoomType.eliteMonster);
levelMap[fightFloor[3]].levelColumn[elitColumn_2].SetUpRoom(RoomType.eliteMonster);
break;
}
@ -538,49 +538,54 @@ public class LeveGeneraterNew : Singleton<LeveGeneraterNew>
//Ëæ»ú½±Àø·¿¼äË¢ÐÂλÖÃ
List<List<LevelNode>> roomKvpList_1 = new List<List<LevelNode>>();
List<List<LevelNode>> roomKvpList_2 = new List<List<LevelNode>>();
for (int i=0;i<3; i++)
{
roomKvpList_1.Add(new List<LevelNode>() { levelMap[rewardFloor[0]].levelColumn[i], levelMap[rewardFloor[1]].levelColumn[i] });
}
for (int i = 0; i < 3; i++)
{
roomKvpList_1.Add(new List<LevelNode>() { levelMap[rewardFloor[2]].levelColumn[i], levelMap[rewardFloor[3]].levelColumn[i] });
roomKvpList_2.Add(new List<LevelNode>() { levelMap[rewardFloor[2]].levelColumn[i], levelMap[rewardFloor[3]].levelColumn[i] });
}
foreach (RoomType roomType in roomCount.Keys.ToList())
{
if (roomCount[roomType] == 3)
if (roomCount[roomType] == 3||roomCount[roomType] == 2)
{
List<int> usedKvpIndexList = new List<int>();//所有已被随机到的房间组序号
List<int> kvpIndexPool = new List<int>();//所有可以随机的房间组序号
for (int i = 0; i < roomKvpList_1.Count; i++)
// List<int> usedKvpIndexList = new List<int>();//所有已被随机到的房间组序号
// List<int> kvpIndexPool = new List<int>();//所有可以随机的房间组序号
//房间组_1
int kvpIndex = Random.Range(0, roomKvpList_1.Count);//随机到的房间组序号
int nodeInex = Random.Range(0, roomKvpList_1[kvpIndex].Count);//房间在房间组内的序号
roomKvpList_1[kvpIndex][nodeInex].SetUpRoom(roomType);
roomKvpList_1[kvpIndex].RemoveAt(nodeInex);
if(roomKvpList_1[kvpIndex].Count==0)
{
kvpIndexPool.Add(i);
roomKvpList_1.RemoveAt(kvpIndex);
}
for (int i = 0; i < 3; i++)
{
int kvpIndex = Random.Range(0, kvpIndexPool.Count);
int index = kvpIndexPool[kvpIndex];//随机到的房间组序号
int nodeInex = Random.Range(0, roomKvpList_1[index].Count);//房间在房间组内的序号
roomKvpList_1[index][nodeInex].SetUpRoom(roomType);
roomKvpList_1[index].RemoveAt(nodeInex);
//房间组_2
int kvpIndex_2 = Random.Range(0, roomKvpList_2.Count);//随机到的房间组序号
int nodeInex_2 = Random.Range(0, roomKvpList_2[kvpIndex_2].Count);//房间在房间组内的序号
roomKvpList_2[kvpIndex_2][nodeInex_2].SetUpRoom(roomType);
roomKvpList_2[kvpIndex_2].RemoveAt(nodeInex_2);
usedKvpIndexList.Add(index);
kvpIndexPool.RemoveAt(kvpIndex);
}
usedKvpIndexList.Sort((x, y) => x.CompareTo(y));
for (int i = usedKvpIndexList.Count - 1; i >= 0; i--)
if (roomKvpList_2[kvpIndex_2].Count == 0)
{
if (roomKvpList_1[usedKvpIndexList[i]].Count == 0)
{
roomKvpList_1.RemoveAt(usedKvpIndexList[i]);
}
roomKvpList_2.RemoveAt(kvpIndex_2);
}
//房间数3特殊处理
if(roomCount[roomType] == 3)
{
roomCount[roomType] = 1;
}
}
}
foreach (RoomType roomType in roomCount.Keys.ToList())
/* foreach (RoomType roomType in roomCount.Keys.ToList())
{
if (roomCount[roomType] == 2)
{
@ -616,29 +621,56 @@ public class LeveGeneraterNew : Singleton<LeveGeneraterNew>
}
}
}
}*/
foreach (RoomType roomType in roomCount.Keys.ToList())
{
if (roomCount[roomType] == 1)
{
List<int> usedKvpIndexList = new List<int>();//所有已被随机到的房间组序号
List<int> kvpIndexPool = new List<int>();//所有可以随机的房间组序号
for (int i = 0; i < roomKvpList_1.Count; i++)
int roomBlockIndex = Random.Range(1, 3);//随机一个房间组
if(roomBlockIndex==1)
{
kvpIndexPool.Add(i);
if(roomKvpList_1 .Count ==0)
{
roomBlockIndex = 2;
}
}
for (int i = 0; i < 1; i++)
if (roomBlockIndex == 2)
{
int kvpIndex = Random.Range(0, kvpIndexPool.Count);
int index = kvpIndexPool[kvpIndex];//随机到的房间组序号
int nodeInex = Random.Range(0, roomKvpList_1[index].Count);//房间在房间组内的序号
if (roomKvpList_2.Count == 0)
{
roomBlockIndex = 1;
}
}
switch (roomBlockIndex)
{
case 1:
//房间组_1
int kvpIndex = Random.Range(0, roomKvpList_1.Count);//随机到的房间组序号
int nodeInex = Random.Range(0, roomKvpList_1[kvpIndex].Count);//房间在房间组内的序号
roomKvpList_1[index][nodeInex].SetUpRoom(roomType);
roomKvpList_1[index].RemoveAt(nodeInex);
roomKvpList_1[kvpIndex][nodeInex].SetUpRoom(roomType);
roomKvpList_1[kvpIndex].RemoveAt(nodeInex);
if (roomKvpList_1[kvpIndex].Count == 0)
{
roomKvpList_1.RemoveAt(kvpIndex);
}
break;
case 2:
//房间组_2
int kvpIndex_2 = Random.Range(0, roomKvpList_2.Count);//随机到的房间组序号
int nodeInex_2 = Random.Range(0, roomKvpList_2[kvpIndex_2].Count);//房间在房间组内的序号
roomKvpList_2[kvpIndex_2][nodeInex_2].SetUpRoom(roomType);
roomKvpList_2[kvpIndex_2].RemoveAt(nodeInex_2);
if (roomKvpList_2[kvpIndex_2].Count == 0)
{
roomKvpList_2.RemoveAt(kvpIndex_2);
}
break;
usedKvpIndexList.Add(index);
kvpIndexPool.RemoveAt(kvpIndex);
}
}
}

44
ColorlessWorld-2024-4-2/Assets/Scripts/MapUnity.cs

@ -495,29 +495,33 @@ public class MapUnity : MonoBehaviour
//锻造界面调用
public void switchColorForging(string newColorString)
{
int newColor = 10;
if (Name.NodeItem.AllItem.Contains(newColorString))
//string[] itemList = newColorString.Split("_");
foreach (string str in newColorString.Split("_"))
{
CardManager.Instance.setItemForSingeNode(newColorString, this, Name.itemBelong.none);
int newColor = 10;
if (Name.NodeItem.AllItem.Contains(str))
{
CardManager.Instance.setItemForSingeNode(str, this, Name.itemBelong.none);
RefreshWhoColor();
continue;
}
else
{
newColor = Name.stringColorToint(str);
}
if (canChange == false || whoColour == Name.NodeColor.Curse)
{
continue;
}
if (whoColour == newColor)
{
continue;
}
whoColour = newColor;
BombAct(newColor);
RefreshWhoColor();
return;
}
else
{
newColor = Name.stringColorToint(newColorString);
}
if (canChange == false || whoColour == Name.NodeColor.Curse)
{
return;
}
if (whoColour == newColor)
{
return;
}
whoColour = newColor;
BombAct(newColor);
RefreshWhoColor();
}
IEnumerator SettleWeaponNode()
{

4
ColorlessWorld-2024-4-2/Assets/Scripts/Weapon/WeaponManager.cs

@ -7,10 +7,10 @@ using UnityEngine;
public class WeaponManager : Singleton<WeaponManager>
{
[Header("�����Ƿ������������")]
[Header("是否结算")]
public bool isWeaponSettle;
[Header("�����������")]
[Header("属性组件")]
//��������ڵ�
/*public List<WeaponNode> playerWeaponNodeList = new List<WeaponNode>();
//���������ڵ�

Loading…
Cancel
Save