# Scripts ## Canvas - CommonCanvas - Intro - Outro - MainMenu - PauseMenu - SettingsMenu - Tooltip - UpgradesShop ## Game Machanics * EnterHousev2 * ExitHouse * Hospital * Inventory * AboutInventory * HealthBarScript * HouseColor * Infection * MainCharacter * MasterReference * NPCInHouse * PlayerXP * UseInventoryItem ## NPC - BubbleSelector - InfectionTransmission - InHouseCollison - InsideHouseMovement - NPC - NPCManager - NPCInfo # Some Rough Idea of Working and linking of Scripts ### UseInventory ```graphviz digraph hierarchy { nodesep=1.0 // increases the separation between nodes node [color=Red,fontname=Courier,shape=box] //All nodes will this shape and colour edge [color=Blue, style=Line] //All OnclickButton -> UseInventory -> TempNpcNameorCharacter -> {useMask , useDrug , usePPEkit , useFirstAid , Hospital} -> MayHaveConditions -> MasterReference -> ChangeLocalVariableValue } ``` ### MainCharacter (HealthCareWorker) ```graphviz digraph hierarchy { nodesep=1.0 // increases the separation between nodes node [color=Brown,fontname=Courier,shape=box] //All nodes will this shape and colour edge [color=purple, ] Character->{Update} -> Input -> Movement -> MasterReference -> SomeFunctions SomeFunctions -> {ifMask , ifPPEKIT , Other} -> Infection -> Update Character -> ifCollided -> tempNpcname ifCollided -> NPC -> InfectionTransmission } ``` ### NPC Script Flow (Rough Idea) Script : NPC , NPCinHouse , MasterRefernce ,Infection , InfectionTansmission , NPCinfo Function : Update , ifCollided(onTriggerEnter2D()) , OtherFunction(UseInventory , ShowingOutline) OherConditionOrFunction : Mask , Drug Rest nodes are Conditions mostly ```graphviz digraph hierarchy { nodesep=0.5 // increases the separation between nodes node [color=Black,fontname=Courier,shape=box] //All nodes will this shape and colour edge [color=Black, style=Line] //All the lines look like this NPC ->Update IfnotHospitalize -> ifTaskAssign -> Journey_to_OtherNPCHouse ->Update IfnotHospitalize -> ifNot -> NPCinHouse -> Update Update ->MasterReference -> OtherConditonsOrFunction -> Infection -> IfnotHospitalize NPC -> ifCollided -> InfectionTransmission ifCollided -> HCworker -> Outline -> OtherFunction Update -> ifHospitalize -> JourneytoHospital -> ifReach-> Hospital -> SomeFunctions-> Update JourneytoHospital -> ifnotReach-> Update } ``` ### NPC Manager NPC Manager Script : It will assign Task to NPC to mover From one House to Another After the NPC script will execute accordingly. NPCManager Script : Check Condition for GameOvercondition by getting Info from MasterRefernce Scripts : NPC , MasterReference , NPCManager GameObject : NPCs(NPC1 ,NPC2 , NPC3 ...) Functions : Start , MakeDecision , GameOverCondition , Update , NPCSetup , GameStartProcess, InfectionStatus ```graphviz digraph hierarchy { nodesep=0.5 node [color=Blue,fontname=Courier,shape=box] edge [color=Black, style=Line] Update ->{MakeDecision} MakeDecision -> NPCs NPCManager->Update NPCs ->{NPC MasterReference} MasterReference -> InfectionStatus -> GameOverCondition -> Update NPCManager -> Start ->{GameStartProcess , NPCSetup} } ``` ### NPC Movement Behavior ### EnterHouse / ExitHouse / Hospital all function are Similar Explanation : When Player enter the Door EnterHouse Script loop for 0.5 Seconds while Door not Open. After it pass message to NPC in NPC enter Home and info Update to MasterReference for other Functions. Also Transform the NPC/HCWorker GameObject : NPC , HCWorker ```graphviz digraph hierarchy { nodesep=1.0 // increases the separation between nodes node [color=Black,fontname=Courier,shape=box] edge [color=Blue, style=line] { NPC HCWorker }-> ifCollidedto -> {EnterHouse , ExitHouse , Hospital} -> MasterRefernce -> TransformingtheGameObject } ```