├── .gitignore ├── Asset folder listing.txt ├── Assets ├── AssetBuilder │ ├── BuildTex.vbp │ ├── BuildTex.vbw │ ├── book_strings.txt │ ├── buildtex_main.bas │ ├── chain.script │ ├── chains.script │ ├── elevators.txt │ ├── object_list.txt │ ├── script_chains.txt │ ├── script_template.txt │ ├── scroll_template.xd │ ├── scrolls_uw1.xd │ ├── sign_strings.txt │ ├── sign_template.xd │ ├── signs_uw1.xd │ ├── strings_clean.txt │ ├── template.mtr │ ├── uw1_0.script │ ├── uw1_1.script │ ├── uw1_2.script │ ├── uw1_entrances.txt │ └── uw1_level_1.script └── Mappings.xls ├── Code Credits.txt ├── Conversations.cpp ├── Conversations.h ├── D3DarkMod.cpp ├── D3DarkMod.h ├── D3DarkModTiles.cpp ├── D3DarkModTiles.h ├── Editor └── UnderworldEditor │ ├── UnderworldEditor.sln │ └── UnderworldEditor │ ├── App.config │ ├── ArtLoader.cs │ ├── ArtUI.cs │ ├── BitmapUW.cs │ ├── BytLoader.cs │ ├── FrmSelect.Designer.cs │ ├── FrmSelect.cs │ ├── FrmSelect.resx │ ├── GRLoader.cs │ ├── Palette.cs │ ├── PaletteLoader.cs │ ├── PictureBoxWithInterpolationMode.cs │ ├── PlayerDatNames.cs │ ├── PlayerDatUI.cs │ ├── Program.cs │ ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings │ ├── TextureLoader.cs │ ├── TileMap.cs │ ├── TileMapUI.cs │ ├── UWStrings.cs │ ├── UnderworldEditor.csproj │ ├── frmRES.Designer.cs │ ├── frmRES.cs │ ├── main.Designer.cs │ ├── main.cs │ ├── main.resx │ ├── objects.cs │ ├── playerdat.cs │ └── util.cs ├── Instructions.doc ├── LICENSE ├── Map list.txt ├── Player_Dat (UW2).xls ├── Skunkworks ├── ArtLoader.cs ├── CnvStack.cs ├── ConversationVM.cs ├── CritterAnimInfo.cs ├── CritterInfo.cs ├── CritterLoader.cs ├── CutsLoader.cs ├── DataLoader.cs ├── MapLoader.cs ├── MeshLoader.cs ├── ObjectInfo.cs ├── ObjectLoader.cs ├── ObjectMasterInfo.cs ├── ObjectMasters.cs ├── Palette.cs ├── PaletteLoader.cs ├── PlayerDatLoader.cs ├── ShockArtLoader.cs ├── ShockLoader.cs ├── StringController.cs ├── TNovaLoader.cs ├── TileInfo.cs └── UWModelLoader.cs ├── SourceEngine.cpp ├── SourceEngine.h ├── TNOVA_path.txt ├── UW2 Conversations ├── UW2COnversationsasm.txt └── UW2_Conversations.txt ├── Underworld 2 Questions.xls ├── Unity.cpp ├── Unity.h ├── UnityScripts ├── AI │ ├── Actions │ │ ├── AI_ATTACK_BASH.cs │ │ ├── AI_ATTACK_BASH.cs.meta │ │ ├── AI_ATTACK_EXECUTE.cs │ │ ├── AI_ATTACK_EXECUTE.cs.meta │ │ ├── AI_ATTACK_MAGIC.cs │ │ ├── AI_ATTACK_RANDOM.cs │ │ ├── AI_ATTACK_RANDOM.cs.meta │ │ ├── AI_ATTACK_RANGED.cs │ │ ├── AI_ATTACK_SECONDARY.cs │ │ ├── AI_ATTACK_SLASH.cs │ │ ├── AI_ATTACK_SLASH.cs.meta │ │ ├── AI_ATTACK_THRUST.cs │ │ ├── AI_ATTACK_THRUST.cs.meta │ │ ├── AI_COMBAT_END.cs │ │ ├── AI_COMBAT_END.cs.meta │ │ ├── AI_COMBAT_IDLE.cs │ │ ├── AI_COMBAT_IDLE.cs.meta │ │ ├── AI_DEATH.cs │ │ ├── AI_DEATH.cs.meta │ │ ├── AI_Destroy.cs │ │ ├── AI_Destroy.cs.meta │ │ ├── AI_IDLE.cs │ │ ├── AI_IDLE.cs.meta │ │ ├── AI_MOVE.cs │ │ ├── AI_MOVE.cs.meta │ │ ├── AI_MoveToPlayer.cs │ │ ├── AI_MoveToPlayer.cs.meta │ │ ├── AI_RANDOM_MOVE.cs │ │ ├── AI_RANDOM_MOVE.cs.meta │ │ ├── AI_STOP_MOVE.cs │ │ ├── AI_STOP_MOVE.cs.meta │ │ └── RainAICustomActiontest.cs.meta │ └── BehaviorTrees │ │ ├── Bragit.asset │ │ └── Bragit.asset.meta ├── Editor │ ├── Test.cs │ └── Test.cs.meta ├── Fonts │ ├── 4x5p.txt │ ├── 5x6i.txt │ ├── 5x6p.txt │ ├── FONT4X5P.ttf │ ├── FONT5X6I.ttf │ ├── FONT5X6P.ttf │ ├── FontBig.ttf │ └── fontbig.txt ├── Shaders │ ├── BasicUWShader.shader │ ├── ColourReplacement.shader │ └── ColourReplacementReverse.shader └── scripts │ ├── Actions │ ├── Action_Activate.cs │ ├── Action_Awaken.cs │ ├── Action_Change_State.cs │ ├── Action_Change_Type.cs │ ├── Action_Choice.cs │ ├── Action_Clone.cs │ ├── Action_Default.cs │ ├── Action_Do_Nothing.cs │ ├── Action_Effect.cs │ ├── Action_Email.cs │ ├── Action_Lighting.cs │ ├── Action_Message.cs │ ├── Action_Moving_Platform.cs │ ├── Action_Radaway.cs │ ├── Action_Resurrection.cs │ ├── Action_Set_Variable.cs │ ├── Action_Spawn.cs │ ├── Action_Timer.cs │ └── Action_Transport_Level.cs │ ├── Combat │ ├── Combat.cs │ ├── ProjectileDamage.cs │ ├── UWCombat.cs │ └── WeaponProps.cs │ ├── Conversations │ ├── CnvStack.cs │ └── ConversationVM.cs │ ├── Cutscenes │ ├── Cuts.cs │ ├── Cutscene_AllWhoOppose.cs │ ├── Cutscene_Arial.cs │ ├── Cutscene_Credits.cs │ ├── Cutscene_Dream_1.cs │ ├── Cutscene_Dream_10.cs │ ├── Cutscene_Dream_2.cs │ ├── Cutscene_Dream_3.cs │ ├── Cutscene_Dream_4.cs │ ├── Cutscene_Dream_5.cs │ ├── Cutscene_Dream_6.cs │ ├── Cutscene_Dream_7.cs │ ├── Cutscene_Dream_8.cs │ ├── Cutscene_Dream_9.cs │ ├── Cutscene_EndGame.cs │ ├── Cutscene_GuardianTaunts.cs │ ├── Cutscene_Incense.cs │ ├── Cutscene_Intro.cs │ ├── Cutscene_PeaceSuchAsThis.cs │ ├── Cutscene_SeeThyFuture.cs │ ├── Cutscene_Splash.cs │ ├── Cutscene_TauntBritish.cs │ ├── Cutscene_ThisWorldIsMine.cs │ └── Cutscene_Tybal.cs │ ├── Events │ ├── event_action.cs │ ├── event_always.cs │ ├── event_base.cs │ ├── event_conditional.cs │ ├── event_fire_triggers.cs │ ├── event_kill_npc.cs │ ├── event_kill_npc_or_race.cs │ ├── event_move_npc.cs │ ├── event_place_npc.cs │ ├── event_processor.cs │ ├── event_remove_npc.cs │ ├── event_scheduled.cs │ ├── event_set_goal.cs │ ├── event_set_goal_alt.cs │ ├── event_set_npc_props.cs │ └── event_set_race_attitude.cs │ ├── Loaders │ ├── ArtLoader.cs │ ├── BytLoader.cs │ ├── CommonObjectDatLoader.cs │ ├── CritLoader.cs │ ├── CritterAnimInfo.cs │ ├── CritterInfo.cs │ ├── CutsLoader.cs │ ├── DataLoader.cs │ ├── GRLoader.cs │ ├── Loader.cs │ ├── MagicLookupTable.cs │ ├── ObjectDatLoader.cs │ ├── ObjectLoader.cs │ ├── ObjectLoaderInfo.cs │ ├── ObjectPropLoader.cs │ ├── PaletteLoader.cs │ ├── TerrainDatLoader.cs │ ├── TextureLoader.cs │ ├── VocLoader.cs │ ├── WeaponsLoader.cs │ └── XFerLoader.cs │ ├── Magic │ ├── BouncingProjectile.cs │ ├── Magic.cs │ ├── MagicProjectile.cs │ ├── SpellEffects │ │ ├── SpellEffect.cs │ │ ├── SpellEffectAccuracy.cs │ │ ├── SpellEffectAlly.cs │ │ ├── SpellEffectBounce.cs │ │ ├── SpellEffectConfusion.cs │ │ ├── SpellEffectCurse.cs │ │ ├── SpellEffectDamage.cs │ │ ├── SpellEffectFear.cs │ │ ├── SpellEffectFlameproof.cs │ │ ├── SpellEffectFreezeTime.cs │ │ ├── SpellEffectHallucination.cs │ │ ├── SpellEffectImmunity.cs │ │ ├── SpellEffectImmunityPoison.cs │ │ ├── SpellEffectLeap.cs │ │ ├── SpellEffectLevitate.cs │ │ ├── SpellEffectLight.cs │ │ ├── SpellEffectLucky.cs │ │ ├── SpellEffectMagicResistant.cs │ │ ├── SpellEffectMazeNavigation.cs │ │ ├── SpellEffectNightVision.cs │ │ ├── SpellEffectParalyze.cs │ │ ├── SpellEffectPetrified.cs │ │ ├── SpellEffectPoison.cs │ │ ├── SpellEffectProtection.cs │ │ ├── SpellEffectRegeneration.cs │ │ ├── SpellEffectRegenerationHealth.cs │ │ ├── SpellEffectRegenerationMana.cs │ │ ├── SpellEffectResistance.cs │ │ ├── SpellEffectResistanceAgainstType.cs │ │ ├── SpellEffectRoamingSight.cs │ │ ├── SpellEffectSlowFall.cs │ │ ├── SpellEffectSpeed.cs │ │ ├── SpellEffectStealth.cs │ │ ├── SpellEffectTelekinesis.cs │ │ ├── SpellEffectToughness.cs │ │ └── SpellEffectWaterWalk.cs │ └── SpellProperties │ │ ├── SpellProp.cs │ │ ├── SpellProp_Acid.cs │ │ ├── SpellProp_Bounce.cs │ │ ├── SpellProp_Curse.cs │ │ ├── SpellProp_DirectDamage.cs │ │ ├── SpellProp_ElectricBolt.cs │ │ ├── SpellProp_Fireball.cs │ │ ├── SpellProp_FlameWind.cs │ │ ├── SpellProp_Heal.cs │ │ ├── SpellProp_Homing.cs │ │ ├── SpellProp_Light.cs │ │ ├── SpellProp_Luck.cs │ │ ├── SpellProp_MagicArrow.cs │ │ ├── SpellProp_Mana.cs │ │ ├── SpellProp_Mind.cs │ │ ├── SpellProp_Movement.cs │ │ ├── SpellProp_Poison.cs │ │ ├── SpellProp_Regen.cs │ │ ├── SpellProp_Resistance.cs │ │ ├── SpellProp_ResistanceAgainstType.cs │ │ ├── SpellProp_RuneOfWarding.cs │ │ ├── SpellProp_SheetLightning.cs │ │ ├── SpellProp_Stealth.cs │ │ ├── SpellProp_SummonMonster.cs │ │ └── SpellProp_Tym.cs │ ├── Motors │ ├── CharacterMotorC.cs │ ├── FPSInputControllerC.cs │ └── taken from.txt │ ├── NPC │ ├── NPC.cs │ ├── NPC_Animation.cs │ ├── NPC_Audio.cs │ ├── NPC_Audio_Data.cs │ ├── NPC_Door.cs │ ├── NPC_VoidCreature.cs │ └── NPC_Wisp.cs │ ├── Objects │ ├── Anvil.cs │ ├── Armour.cs │ ├── Arrow.cs │ ├── Barrel.cs │ ├── Bed.cs │ ├── Bedroll.cs │ ├── BlackrockGem.cs │ ├── Boots.cs │ ├── Boulder.cs │ ├── Bridge.cs │ ├── Chest.cs │ ├── Coin.cs │ ├── CommonObjProps.cs │ ├── ComputerScreen.cs │ ├── Critters.cs │ ├── Decal.cs │ ├── DjinnBottle.cs │ ├── DoorControl.cs │ ├── DoorControlShock.cs │ ├── DoorKey.cs │ ├── DreamPlant.cs │ ├── Drink.cs │ ├── Equipment.cs │ ├── FishingPole.cs │ ├── Food.cs │ ├── Fountain.cs │ ├── Gloves.cs │ ├── Grave.cs │ ├── Helm.cs │ ├── Instrument.cs │ ├── Lantern.cs │ ├── LargeBlackrockGem.cs │ ├── Leech.cs │ ├── Leggings.cs │ ├── LightSource.cs │ ├── LockPick.cs │ ├── MagicScroll.cs │ ├── Map.cs │ ├── MapPiece.cs │ ├── MobileObject.cs │ ├── Model3D.cs │ ├── MoonGate.cs │ ├── MoonStone.cs │ ├── ObjectInteraction.cs │ ├── ObjectMasters.cs │ ├── ObjectVariables.cs │ ├── Oil.cs │ ├── Orb.cs │ ├── OrbRock.cs │ ├── Pillar.cs │ ├── PocketWatch.cs │ ├── Pole.cs │ ├── PortcullisInteraction.cs │ ├── Potion.cs │ ├── Props.cs │ ├── Readable.cs │ ├── ReadableTrap.cs │ ├── Ring.cs │ ├── RuneBag.cs │ ├── RuneStone.cs │ ├── Shield.cs │ ├── Shrine.cs │ ├── Sign.cs │ ├── SilverSeed.cs │ ├── SilverTree.cs │ ├── Spike.cs │ ├── StorageCrystal.cs │ ├── TMAP.cs │ ├── UWPainting.cs │ ├── Wand.cs │ ├── Weapon.cs │ ├── WeaponMelee.cs │ ├── WeaponRanged.cs │ ├── Words.cs │ ├── Zanium.cs │ ├── a_candle.cs │ ├── a_spell.cs │ ├── a_splash.cs │ ├── container_obj.cs │ ├── enchantment_base.cs │ ├── forcefield.cs │ ├── genericmodel3d.cs │ ├── map_object.cs │ └── object_base.cs │ ├── Player Character │ ├── CameraShake.cs │ ├── Character.cs │ ├── Chargen.cs │ ├── Container.cs │ ├── ContainerOpened.cs │ ├── Feet.cs │ ├── IceCollision.cs │ ├── PlayerInventory.cs │ ├── SaveGame.cs │ ├── ShockCharacter.cs │ ├── Skills.cs │ └── UWCharacter.cs │ ├── Traps │ ├── a_arrow_trap.cs │ ├── a_bridge_trap.cs │ ├── a_change_from_trap.cs │ ├── a_change_terrain_trap.cs │ ├── a_change_to_trap.cs │ ├── a_check_variable_trap.cs │ ├── a_combination_trap.cs │ ├── a_create_object_trap.cs │ ├── a_damage_trap.cs │ ├── a_delete_object_trap.cs │ ├── a_do_trapBullfrog.cs │ ├── a_do_trap_EndGame.cs │ ├── a_do_trap_camera.cs │ ├── a_do_trap_conversation.cs │ ├── a_do_trap_emeraldpuzzle.cs │ ├── a_do_trap_jailor.cs │ ├── a_do_trap_platform.cs │ ├── a_door_trap.cs │ ├── a_hack_trap.cs │ ├── a_hack_trap_button_flicker.cs │ ├── a_hack_trap_button_mover.cs │ ├── a_hack_trap_castle_npcs.cs │ ├── a_hack_trap_change_goal.cs │ ├── a_hack_trap_class_item.cs │ ├── a_hack_trap_colour_cycle.cs │ ├── a_hack_trap_coward.cs │ ├── a_hack_trap_floorcollapse.cs │ ├── a_hack_trap_forcefield.cs │ ├── a_hack_trap_gemrotate.cs │ ├── a_hack_trap_light_recharge.cs │ ├── a_hack_trap_platformwave.cs │ ├── a_hack_trap_qbert.cs │ ├── a_hack_trap_recycle.cs │ ├── a_hack_trap_scintplatformreset.cs │ ├── a_hack_trap_scintpuzzlereset.cs │ ├── a_hack_trap_skup.cs │ ├── a_hack_trap_sleep.cs │ ├── a_hack_trap_spoil_potion.cs │ ├── a_hack_trap_teleport.cs │ ├── a_hack_trap_terraform_puzzle.cs │ ├── a_hack_trap_texture.cs │ ├── a_hack_trap_tmap_range_change.cs │ ├── a_hack_trap_trespass.cs │ ├── a_hack_trap_unlink.cs │ ├── a_hack_trap_vending.cs │ ├── a_hack_trap_vendingselect.cs │ ├── a_hack_trap_vendingsign.cs │ ├── a_hack_trap_visibility.cs │ ├── a_jump_trap.cs │ ├── a_lock.cs │ ├── a_null_trap.cs │ ├── a_pit_trap.cs │ ├── a_proximity_trap.cs │ ├── a_set_variable_trap.cs │ ├── a_skill_trap.cs │ ├── a_special_effect_trap.cs │ ├── a_spelltrap.cs │ ├── a_teleport_trap.cs │ ├── a_tell_trap.cs │ ├── a_text_string_trap.cs │ ├── a_variable_trap.cs │ ├── a_ward_trap.cs │ ├── an_experience_trap.cs │ ├── an_inventory_trap.cs │ ├── an_oscillator_trap.cs │ └── trap_base.cs │ ├── Triggers │ ├── ButtonHandler.cs │ ├── Entry_Trigger.cs │ ├── Null_Trigger.cs │ ├── ShockButtonHandler.cs │ ├── TriggerHandler.cs │ ├── a_close_trigger.cs │ ├── a_look_trigger.cs │ ├── a_move_trigger.cs │ ├── a_pick_up_trigger.cs │ ├── a_pressure_trigger.cs │ ├── a_scheduled_trigger.cs │ ├── a_step_on_trigger.cs │ ├── a_timer_trigger.cs │ ├── a_use_trigger.cs │ ├── an_enter_trigger.cs │ ├── an_exit_trigger.cs │ ├── an_open_trigger.cs │ ├── an_unlock_trigger.cs │ ├── traptrigger_base.cs │ └── trigger_base.cs │ ├── UI │ ├── ActiveRuneSlot.cs │ ├── AnimationOverlay.cs │ ├── ChargenButton.cs │ ├── ClearRunes.cs │ ├── Compass.cs │ ├── CompassPoint.cs │ ├── ConversationButton.cs │ ├── CutsAnimator.cs │ ├── CutsceneAnimation.cs │ ├── CutsceneAnimationFullscreen.cs │ ├── DragAndDrop.cs │ ├── Dragons.cs │ ├── Eyes.cs │ ├── GameSelect.cs │ ├── GuiBase.cs │ ├── GuiBase_Draggable.cs │ ├── HUD.cs │ ├── HealthFlask.cs │ ├── HudAnimation.cs │ ├── Hud_Hover.cs │ ├── InputHandler.cs │ ├── InteractionModeControl.cs │ ├── InteractionModeControlItem.cs │ ├── InventorySlot.cs │ ├── KeyBindings.cs │ ├── LevelTeleportButton.cs │ ├── MainMenuButton.cs │ ├── MainMenuHud.cs │ ├── MapClose.cs │ ├── MapInteraction.cs │ ├── MapNote.cs │ ├── MapNoteId.cs │ ├── MapWorldSelect.cs │ ├── MouseLocker.cs │ ├── MouseTracker.cs │ ├── NovaLevelSelect.cs │ ├── OptionsMenuButton.cs │ ├── OptionsMenuControl.cs │ ├── Power.cs │ ├── RuneSlot.cs │ ├── SaveGameButton.cs │ ├── ScrollButtonInventory.cs │ ├── ScrollButtonStatsDisplay.cs │ ├── ScrollController.cs │ ├── Scrollbutton.cs │ ├── SpellEffectsDisplay.cs │ ├── StatsDisplay.cs │ ├── TextureMapButton.cs │ ├── TradeIndicator.cs │ ├── TradeSlot.cs │ ├── UWHUD.cs │ ├── WeaponAnimation.cs │ ├── WeaponAnimationPlayer.cs │ ├── WindowDetect.cs │ ├── WindowDetectUW.cs │ └── chains.cs │ ├── UnderworldGenerator │ ├── CaveRegion.cs │ ├── Connector.cs │ ├── GeneratorClasses.cs │ ├── GeneratorMap.cs │ ├── Region.cs │ ├── RoomRegion.cs │ └── UnderworldGenerator.cs │ ├── Utility │ ├── Billboard.cs │ ├── BillboardNPC.cs │ ├── Impact.cs │ ├── LevArk.cs │ ├── Palette.cs │ ├── PersistObject.cs │ ├── RemoteCamera.cs │ ├── RemoteCameraCapture.cs │ ├── RemoteCameraRender.cs │ ├── ShockStartup.cs │ ├── StringController.cs │ ├── TGALoader.cs │ ├── TextureController.cs │ ├── UWClass.cs │ ├── UWEBase.cs │ └── UWPalette.cs │ └── World │ ├── AutoMap.cs │ ├── GameClock.cs │ ├── GameWorldController.cs │ ├── IngameEditor.cs │ ├── MusicController.cs │ ├── Quest.cs │ ├── Repulsor.cs │ ├── ShrineLava.cs │ ├── TileContact.cs │ ├── TileContactLava.cs │ ├── TileContactMud.cs │ ├── TileContactTrigger.cs │ ├── TileContactWater.cs │ ├── TileInfo.cs │ ├── TileMap.cs │ ├── TileMapRenderer.cs │ └── WhatTheHellIsSCD_ARK.cs ├── asciimode.cpp ├── asciimode.h ├── assets ├── guis │ ├── assets │ │ └── shock │ │ │ ├── logs │ │ │ └── logs.txt │ │ │ ├── screens │ │ │ └── screens.txt │ │ │ └── switches │ │ │ └── switches.txt │ ├── readables │ │ ├── log.gui │ │ ├── shock_transparent.gui │ │ └── shock_transparent_world.gui │ └── shock │ │ ├── cam.gui │ │ ├── door_10_0_0.gui │ │ ├── door_10_0_1.gui │ │ ├── door_10_0_4.gui │ │ ├── door_10_0_6.gui │ │ ├── door_10_2_5.gui │ │ ├── door_10_3_1.gui │ │ ├── doortest.gui │ │ ├── screen.gui │ │ ├── screen_0_4_0.gui │ │ ├── screen_19_4_1.gui │ │ ├── screen_20_0_0.gui │ │ ├── screen_26_0_0.gui │ │ ├── screen_29_0_0.gui │ │ ├── screen_30_0_0.gui │ │ ├── screen_30_1_0.gui │ │ ├── screen_31_4_0.gui │ │ ├── screen_39_4_2.gui │ │ ├── screen_40_4_0.gui │ │ ├── screen_43_4_1.gui │ │ ├── screen_43_4_43.gui │ │ ├── screen_47_0_0.gui │ │ ├── screen_47_4_0.gui │ │ ├── screen_48_4_1.gui │ │ ├── screen_4_4_0.gui │ │ ├── screen_4_4_1.gui │ │ ├── screen_50_4_0.gui │ │ ├── screen_51_4_0.gui │ │ ├── screen_51_4_1.gui │ │ ├── screen_52_4_1.gui │ │ ├── screen_55_4_0.gui │ │ ├── screen_55_8_0.gui │ │ ├── screen_63_6_0.gui │ │ ├── screen_64_4_0.gui │ │ ├── screen_67_4_0.gui │ │ ├── screen_69_8_0.gui │ │ ├── screen_6_4_1.gui │ │ ├── screen_79_4_0.gui │ │ ├── screen_79_4_1.gui │ │ ├── screen_80_4_0.gui │ │ ├── screen_80_4_1.gui │ │ ├── screen_81_4_0.gui │ │ ├── screen_81_4_1.gui │ │ ├── screen_83_4_0.gui │ │ ├── screen_85_4_0.gui │ │ ├── screen_85_4_1.gui │ │ ├── screen_89_4_0.gui │ │ ├── screen_89_4_1.gui │ │ ├── screen_8_4_0.gui │ │ ├── screen_8_4_1.gui │ │ ├── screen_8_4_2.gui │ │ ├── screen_8_4_8.gui │ │ ├── screen_91_4_0.gui │ │ ├── screen_91_4_1.gui │ │ ├── screen_93_3_0.gui │ │ ├── screen_93_4_0.gui │ │ ├── switch.gui │ │ ├── switch_9_0_0.gui │ │ ├── switch_9_0_1.gui │ │ ├── switch_9_0_2.gui │ │ ├── switch_9_0_3.gui │ │ ├── switch_9_0_4.gui │ │ ├── switch_9_0_5.gui │ │ ├── switch_9_0_6.gui │ │ ├── switch_9_0_7.gui │ │ ├── switch_9_3_0.gui │ │ ├── switch_9_3_1.gui │ │ ├── switch_9_3_10.gui │ │ ├── switch_9_3_2.gui │ │ ├── switch_9_3_3.gui │ │ ├── switch_9_3_4.gui │ │ ├── switch_9_3_5.gui │ │ ├── switch_9_3_6.gui │ │ ├── switch_9_3_7.gui │ │ ├── switch_9_3_8.gui │ │ ├── switch_9_3_9.gui │ │ └── test.gui ├── materials │ └── materials.txt ├── models │ ├── shock │ │ ├── elephant.ase │ │ ├── null.ase │ │ ├── rechargestation.ase │ │ ├── shock_bridge.ase │ │ ├── shock_button_16.ase │ │ ├── shock_button_32.ase │ │ ├── shock_icon_0000.ase │ │ ├── shock_screen_large.ase │ │ ├── shock_screen_medium.ase │ │ ├── shock_screen_small.ase │ │ ├── shock_screen_small_collision.ase │ │ ├── shock_sign_0000.ase │ │ ├── shock_words_0000.ase │ │ └── surgerymachine.ase │ └── uw1 │ │ ├── serv.ase │ │ ├── servbot2.ase │ │ ├── spritetest.ase │ │ ├── uw1_bridge.ase │ │ └── uw1_sign.ase ├── skins │ └── shock_icon.skin ├── sound │ ├── sfx │ │ ├── shock_barks │ │ │ └── shock_barks.txt │ │ └── shock_logs │ │ │ └── shock_logs.txt │ └── sound.txt ├── textures │ ├── shock │ │ └── shock_textures.txt │ ├── uw1 │ │ └── uw1 textures.txt │ └── uw2 │ │ └── uw2 textures.txt └── xdata │ ├── key.xd │ ├── logs_shock.xd │ ├── scrolls_uw1.xd │ └── shock_words.xd ├── config.ini ├── fbxExport.cpp ├── fbxExport.h ├── fontdecode.cpp ├── gamegraphics.cpp ├── gamegraphics.h ├── gameobjects.cpp ├── gameobjects.h ├── gameobjectsrender.cpp ├── gameobjectsrender.h ├── gamepaths.txt ├── gamestrings.cpp ├── gamestrings.h ├── hacking.h ├── light theory updated.txt ├── main.cpp ├── main.h ├── materials.cpp ├── materials.h ├── modding.txt ├── player_dat (uw1).xls ├── readme.md ├── scd_ark research file.xls ├── scd_ark.xls ├── scripting.cpp ├── scripting.h ├── shock_object_config.txt ├── shock_object_settings.txt ├── shock_texture_config.txt ├── shock_texture_config_source.txt ├── spell effects.xls ├── ss1 animations list 1.xls ├── textures.h ├── tilemap.cpp ├── tilemap.h ├── underworld spells.xls ├── unity.txt ├── unity_tiles.txt ├── utils.cpp ├── utils.h ├── uw1_config.txt ├── uw1_entrances.txt ├── uw1_object_config.txt ├── uw1_object_config_backup.txt ├── uw1_object_settings.txt ├── uw1_retro_config.txt ├── uw1_retro_config_source.txt ├── uw1_stringsclean.txt ├── uw2_object_config.txt ├── uw2_object_config_backup.txt ├── uw2_object_settings.txt ├── uw2_retro_config.txt └── uw2_retro_config_source.txt /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | UnityScripts/scripts/Motors/CharacterMotorC.cs 3 | UnityScripts/scripts/Motors/FPSInputControllerC.cs 4 | UnityScripts/scripts/Motors/CharacterMotorC.cs 5 | UnityScripts/scripts/Motors/FPSInputControllerC.cs 6 | UnityScripts/scripts/Motors/FPSInputControllerC.cs 7 | -------------------------------------------------------------------------------- /Assets/AssetBuilder/BuildTex.vbp: -------------------------------------------------------------------------------- 1 | Type=Exe 2 | Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\..\..\..\WINDOWS\system32\stdole2.tlb#OLE Automation 3 | Module=buildtex_main; buildtex_main.bas 4 | Startup="Sub Main" 5 | Command32="" 6 | Name="buildTex" 7 | HelpContextID="0" 8 | CompatibleMode="0" 9 | MajorVer=1 10 | MinorVer=0 11 | RevisionVer=0 12 | AutoIncrementVer=0 13 | ServerSupportFiles=0 14 | VersionCompanyName="" 15 | CompilationType=0 16 | OptimizationType=0 17 | FavorPentiumPro(tm)=0 18 | CodeViewDebugInfo=0 19 | NoAliasing=0 20 | BoundsCheck=0 21 | OverflowCheck=0 22 | FlPointCheck=0 23 | FDIVCheck=0 24 | UnroundedFP=0 25 | StartMode=0 26 | Unattended=0 27 | Retained=0 28 | ThreadPerObject=0 29 | MaxNumberOfThreads=1 30 | 31 | [MS Transaction Server] 32 | AutoRefresh=1 33 | -------------------------------------------------------------------------------- /Assets/AssetBuilder/BuildTex.vbw: -------------------------------------------------------------------------------- 1 | buildtex_main = 29, 18, 894, 555, 2 | -------------------------------------------------------------------------------- /Assets/AssetBuilder/elevators.txt: -------------------------------------------------------------------------------- 1 | level-0-index-623-state-4-trigger-a_use_trigger-Points-a_do_trap-x-49-y-44 2 | level-0-index-870-state-3-trigger-a_use_trigger-Points-a_do_trap-x-47-y-44 3 | level-0-index-871-state-2-trigger-a_use_trigger-Points-a_do_trap-x-45-y-44 4 | level-0-index-872-state-1-trigger-a_use_trigger-Points-a_do_trap-x-43-y-44 -------------------------------------------------------------------------------- /Assets/AssetBuilder/object_list.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hankmorgan/UnderworldExporter/64f5c2310e95c2e507725b9c69955e645b80de0b/Assets/AssetBuilder/object_list.txt -------------------------------------------------------------------------------- /Assets/AssetBuilder/script_template.txt: -------------------------------------------------------------------------------- 1 | #define __<>_<>_script__ 2 | 3 | <> 4 | 5 | void main() 6 | { 7 | 8 | 9 | } 10 | 11 | 12 | <> 13 | 14 | 15 | 16 | #endif //__<>_<>_script__ -------------------------------------------------------------------------------- /Assets/AssetBuilder/scroll_template.xd: -------------------------------------------------------------------------------- 1 | readables/<>/scroll_<> 2 | { 3 | precache 4 | "num_pages" : "1" 5 | "page1_title" : 6 | { 7 | "" 8 | } 9 | "page1_body" : 10 | { 11 | "<>" 12 | } 13 | "gui_page1" : "guis/readables/sheets/sheet_paper_hand_nancy.gui" 14 | "snd_page_turn" : "readable_page_turn" 15 | } -------------------------------------------------------------------------------- /Assets/AssetBuilder/sign_template.xd: -------------------------------------------------------------------------------- 1 | readables/<>/sign_<> 2 | { 3 | precache 4 | "num_pages" : "1" 5 | "page1_title" : 6 | { 7 | "" 8 | } 9 | "page1_body" : 10 | { 11 | "<>" 12 | } 13 | "gui_page1" : "guis/readables/transparent.gui" 14 | "snd_page_turn" : "readable_page_turn" 15 | } -------------------------------------------------------------------------------- /Assets/AssetBuilder/uw1_entrances.txt: -------------------------------------------------------------------------------- 1 | LevelNo TileX TileY 2 | 1 7 38 3 | 1 47 53 4 | 1 35 20 5 | 2 25 10 6 | 2 42 61 7 | 0 26 20 8 | 0 8 34 9 | 2 5 2 -------------------------------------------------------------------------------- /Assets/Mappings.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hankmorgan/UnderworldExporter/64f5c2310e95c2e507725b9c69955e645b80de0b/Assets/Mappings.xls -------------------------------------------------------------------------------- /Code Credits.txt: -------------------------------------------------------------------------------- 1 | Code credits from previous UW and System Shock Projects. 2 | 3 | 1 Strings decompression adapted from Abysmal+Underworld Adventures 4 | 2 Bitmap header code adapted from System Shock Dump Texture 5 | 3 System Shock decompression from ss-specs.txt 6 | 4 UW2 decompression from Labyrinth of Worlds project. 7 | 5 Height unit shifting idea borrowed from Abysmal. 8 | 6 UW Image Decompression algorithm based on abysmal version. 9 | 7 RLE Decoder lifted from UWAdventures 10 | 8 Cutscene implementation stolen from UWAdventures. 11 | 9 Bitmap decompression for SHOCK from the DumpTex utility 12 | 10 Font extraction based taken from UWAdventures hacking tools 13 | 11 Billboard implementation inspired by Citadel project. 14 | 12 Implementation of Conversation vm opcodes from Underworld adventures hacking tools. 15 | 16 | 17 | THANKS!!!!!! -------------------------------------------------------------------------------- /Conversations.h: -------------------------------------------------------------------------------- 1 | #ifndef Conversations_h 2 | #define Conversations_h 3 | 4 | #define cnv_NOP 0 5 | #define cnv_OPADD 1 6 | #define cnv_OPMUL 2 7 | #define cnv_OPSUB 3 8 | #define cnv_OPDIV 4 9 | #define cnv_OPMOD 5 10 | #define cnv_OPOR 6 11 | #define cnv_OPAND 7 12 | #define cnv_OPNOT 8 13 | #define cnv_TSTGT 9 14 | #define cnv_TSTGE 10 15 | #define cnv_TSTLT 11 16 | #define cnv_TSTLE 12 17 | #define cnv_TSTEQ 13 18 | #define cnv_TSTNE 14 19 | #define cnv_JMP 15 20 | #define cnv_BEQ 16 21 | #define cnv_BNE 17 22 | #define cnv_BRA 18 23 | #define cnv_CALL 19 24 | #define cnv_CALLI 20 25 | #define cnv_RET 21 26 | #define cnv_PUSHI 22 27 | #define cnv_PUSHI_EFF 23 28 | #define cnv_POP 24 29 | #define cnv_SWAP 25 30 | #define cnv_PUSHBP 26 31 | #define cnv_POPBP 27 32 | #define cnv_SPTOBP 28 33 | #define cnv_BPTOSP 29 34 | #define cnv_ADDSP 30 35 | #define cnv_FETCHM 31 36 | #define cnv_STO 32 37 | #define cnv_OFFSET 33 38 | #define cnv_START 34 39 | #define cnv_SAVE_REG 35 40 | #define cnv_PUSH_REG 36 41 | #define cnv_STRCMP 37 42 | #define cnv_EXIT_OP 38 43 | #define cnv_SAY_OP 39 44 | #define cnv_RESPOND_OP 40 45 | #define cnv_OPNEG 41 46 | 47 | 48 | 49 | 50 | 51 | 52 | void ExtractConversations(int game); 53 | void ExtractConversationsUW2(int game); 54 | #endif /* Conversations_h */ -------------------------------------------------------------------------------- /D3DarkModTiles.h: -------------------------------------------------------------------------------- 1 | #ifndef d3darkmodTiles_h 2 | #define d3darkmodTiles_h 3 | 4 | #include "tilemap.h" 5 | 6 | void RenderWaterTiles(int game, tile LevelInfo[64][64], int x, int y); 7 | void RenderChangeTerrainTiles(int game, tile LevelInfo[64][64]); 8 | void RenderBullFrogTiles(int game, tile LevelInfo[64][64]); 9 | #endif /* d3darkmodTiles_h */ -------------------------------------------------------------------------------- /Editor/UnderworldEditor/UnderworldEditor.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27703.2042 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnderworldEditor", "UnderworldEditor\UnderworldEditor.csproj", "{BABC145D-4A93-4AAF-B6A7-00FE094436EB}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {BABC145D-4A93-4AAF-B6A7-00FE094436EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {BABC145D-4A93-4AAF-B6A7-00FE094436EB}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {BABC145D-4A93-4AAF-B6A7-00FE094436EB}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {BABC145D-4A93-4AAF-B6A7-00FE094436EB}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {ACA62938-E10F-41A2-B1C4-04523CE04E32} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /Editor/UnderworldEditor/UnderworldEditor/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Editor/UnderworldEditor/UnderworldEditor/PictureBoxWithInterpolationMode.cs: -------------------------------------------------------------------------------- 1 |  using System.Drawing.Drawing2D; 2 | using System.Windows.Forms; 3 | 4 | /// 5 | /// Inherits from PictureBox; adds Interpolation Mode Setting 6 | /// 7 | public class PictureBoxWithInterpolationMode : PictureBox 8 | { 9 | public InterpolationMode InterpolationMode { get; set; } 10 | 11 | protected override void OnPaint(PaintEventArgs paintEventArgs) 12 | { 13 | paintEventArgs.Graphics.InterpolationMode = InterpolationMode; 14 | base.OnPaint(paintEventArgs); 15 | } 16 | } -------------------------------------------------------------------------------- /Editor/UnderworldEditor/UnderworldEditor/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | 7 | namespace UnderworldEditor 8 | { 9 | static class Program 10 | { 11 | /// 12 | /// The main entry point for the application. 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | Application.EnableVisualStyles(); 18 | Application.SetCompatibleTextRenderingDefault(false); 19 | Application.Run(new main()); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Editor/UnderworldEditor/UnderworldEditor/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace UnderworldEditor.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Editor/UnderworldEditor/UnderworldEditor/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Editor/UnderworldEditor/UnderworldEditor/frmRES.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | 11 | namespace UnderworldEditor 12 | { 13 | public partial class frmRES : Form 14 | { 15 | public frmRES() 16 | { 17 | InitializeComponent(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Instructions.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hankmorgan/UnderworldExporter/64f5c2310e95c2e507725b9c69955e645b80de0b/Instructions.doc -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Hank Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Map list.txt: -------------------------------------------------------------------------------- 1 | Level Nos 2 | 3 | Uw2 4 | 0-4 Britannia 5 | 8-15 Prison Tower 6 | 16-17 Killorn Keep 7 | 24-25 Ice Caverns 8 | 32-33 Talorus 9 | 40-47 Academy 10 | 48-51 Tomb 11 | 56-58 Pits 12 | 64-72 Void 65 is stickman level 13 | -------------------------------------------------------------------------------- /Player_Dat (UW2).xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hankmorgan/UnderworldExporter/64f5c2310e95c2e507725b9c69955e645b80de0b/Player_Dat (UW2).xls -------------------------------------------------------------------------------- /Skunkworks/CnvStack.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class CnvStack { 5 | 6 | public int[] StackValues; 7 | public int stackptr; 8 | 9 | 10 | public CnvStack(int stackSize) 11 | { 12 | StackValues=new int[stackSize]; 13 | stackptr=0; 14 | /*for (int i=0; i<=StackValues.GetUpperBound(0);i++) 15 | { 16 | StackValues[i]=i; 17 | }*/ 18 | } 19 | 20 | public int Pop() 21 | { 22 | stackptr--; 23 | int popvalue = StackValues[stackptr]; 24 | StackValues[stackptr]=0; 25 | return popvalue; 26 | } 27 | 28 | public void Push(int newValue) 29 | { 30 | StackValues[stackptr++]=newValue; 31 | } 32 | 33 | public void Set(int arg1, int arg2) 34 | { 35 | StackValues[arg1]=arg2;//I hope! 36 | } 37 | 38 | public int get_stackp() 39 | { 40 | return stackptr; 41 | } 42 | 43 | public void set_stackp(int ptr) 44 | { 45 | stackptr=ptr; 46 | } 47 | 48 | public int at(int index) 49 | { 50 | return StackValues[index]; 51 | } 52 | } 53 | 54 | 55 | -------------------------------------------------------------------------------- /Skunkworks/CritterAnimInfo.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class CritterAnimInfo { 5 | 6 | public string[,] animSequence; 7 | public int[,] animIndices; 8 | public Sprite[] animSprites; 9 | public string[] animName; 10 | 11 | public CritterAnimInfo() 12 | { 13 | animSequence=new string[32,8]; 14 | animIndices=new int[32,8]; 15 | animSprites=new Sprite[200];//In order 16 | animName=new string[32]; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Skunkworks/MeshLoader.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class MeshLoader : MonoBehaviour { 5 | 6 | public Vector3[] newVertices; 7 | public Vector2[] newUV; 8 | 9 | public int[] SecondTriangles; 10 | 11 | public Mesh mesh; 12 | 13 | 14 | public int[] newTriangles; 15 | 16 | void Start() 17 | { 18 | Mesh mesh = new Mesh(); 19 | GetComponent().mesh = mesh; 20 | } 21 | 22 | void Update() { 23 | if(mesh==null) 24 | { 25 | mesh = new Mesh(); 26 | GetComponent().mesh = mesh; 27 | } 28 | mesh.subMeshCount=2; 29 | mesh.vertices = newVertices; 30 | mesh.uv = newUV; 31 | 32 | mesh.SetTriangles(newTriangles,0); 33 | mesh.SetTriangles(SecondTriangles,1); 34 | //mesh.triangles = newTriangles; 35 | 36 | 37 | mesh.RecalculateNormals(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Skunkworks/Palette.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | /// 5 | /// Game Palettes. 6 | /// 7 | public class Palette { 8 | 9 | public byte[] red= new byte[256]; 10 | public byte[] blue= new byte[256]; 11 | public byte[] green= new byte[256]; 12 | 13 | 14 | 15 | public Color32 ColorAtPixel(byte pixel, bool Alpha) 16 | { 17 | byte alpha; 18 | if (Alpha == true) 19 | { 20 | if (pixel != 0) //Alpha 21 | { 22 | alpha = 255; 23 | } 24 | else 25 | { 26 | alpha = 0; 27 | } 28 | } 29 | else 30 | { 31 | alpha = 0; 32 | } 33 | return new Color32(red[pixel], green[pixel],blue[pixel], alpha); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /TNOVA_path.txt: -------------------------------------------------------------------------------- 1 | C:\Games\Terra Nova\CD\Terra_Nova\ -------------------------------------------------------------------------------- /Underworld 2 Questions.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hankmorgan/UnderworldExporter/64f5c2310e95c2e507725b9c69955e645b80de0b/Underworld 2 Questions.xls -------------------------------------------------------------------------------- /Unity.h: -------------------------------------------------------------------------------- 1 | #ifndef Unity_h 2 | #define Unity_h 3 | #include "tilemap.h" 4 | #include "gameobjects.h" 5 | 6 | void RenderUnityObjectList(int game, int Level, tile LevelInfo[64][64], ObjectItem objList[1600]); 7 | void PrintUnityTileMap(int game, int Level, tile LevelInfo[64][64]); 8 | void UnityRotation(int game, int angle1, int angle2, int angle3); 9 | void setLink(ObjectItem currobj); 10 | void setSprite(unsigned char *SpriteName); 11 | void SetButtonProperties(int game, short on, int SpriteNoOn, int SpriteNoOff); 12 | void SetButtonProperties(int game, int SpriteNoBegin); 13 | void SetScale(float x, float y, float z); 14 | void setReadable(); 15 | #endif -------------------------------------------------------------------------------- /UnityScripts/AI/Actions/AI_ATTACK_BASH.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using RAIN.Action; 5 | using RAIN.Core; 6 | 7 | [RAINAction] 8 | public class AI_ATTACK_BASH : RAINAction 9 | { 10 | public override void Start(RAIN.Core.AI ai) 11 | { 12 | base.Start(ai); 13 | } 14 | 15 | public override ActionResult Execute(RAIN.Core.AI ai) 16 | { 17 | NPC npc= ai.Body.GetComponent(); 18 | npc.AnimRange=NPC.AI_ANIM_ATTACK_BASH; 19 | //gob.executeAttack(); 20 | return ActionResult.SUCCESS; 21 | } 22 | 23 | public override void Stop(RAIN.Core.AI ai) 24 | { 25 | base.Stop(ai); 26 | } 27 | } -------------------------------------------------------------------------------- /UnityScripts/AI/Actions/AI_ATTACK_BASH.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7549368577b75364da4c6d523a1c60fb 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /UnityScripts/AI/Actions/AI_ATTACK_EXECUTE.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using RAIN.Action; 5 | using RAIN.Core; 6 | 7 | [RAINAction] 8 | public class AI_ATTACK_EXECUTE : RAINAction 9 | { 10 | public override void Start(RAIN.Core.AI ai) 11 | { 12 | base.Start(ai); 13 | } 14 | 15 | public override ActionResult Execute(RAIN.Core.AI ai) 16 | { 17 | NPC npc= ai.Body.GetComponent(); 18 | npc.ExecuteAttack(); 19 | 20 | return ActionResult.SUCCESS; 21 | } 22 | 23 | public override void Stop(RAIN.Core.AI ai) 24 | { 25 | base.Stop(ai); 26 | } 27 | } -------------------------------------------------------------------------------- /UnityScripts/AI/Actions/AI_ATTACK_EXECUTE.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c439fb72ac067e64898afa6bf7506b8f 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /UnityScripts/AI/Actions/AI_ATTACK_MAGIC.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using RAIN.Action; 5 | using RAIN.Core; 6 | 7 | [RAINAction] 8 | public class AI_ATTACK_MAGIC : RAINAction 9 | { 10 | public override void Start(RAIN.Core.AI ai) 11 | { 12 | base.Start(ai); 13 | } 14 | 15 | public override ActionResult Execute(RAIN.Core.AI ai) 16 | { 17 | NPC npc= ai.Body.GetComponent(); 18 | npc.ExecuteMagicAttack(); 19 | 20 | return ActionResult.SUCCESS; 21 | } 22 | 23 | public override void Stop(RAIN.Core.AI ai) 24 | { 25 | base.Stop(ai); 26 | } 27 | } -------------------------------------------------------------------------------- /UnityScripts/AI/Actions/AI_ATTACK_RANDOM.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using RAIN.Action; 5 | using RAIN.Core; 6 | 7 | [RAINAction] 8 | public class AI_ATTACK_RANDOM : RAINAction 9 | { 10 | public override void Start(RAIN.Core.AI ai) 11 | { 12 | base.Start(ai); 13 | } 14 | 15 | public override ActionResult Execute(RAIN.Core.AI ai) 16 | { 17 | NPC npc= ai.Body.GetComponent(); 18 | switch (Random.Range(0,3)) 19 | { 20 | case 0: 21 | npc.AnimRange=NPC.AI_ANIM_ATTACK_BASH;break; 22 | case 1: 23 | npc.AnimRange=NPC.AI_ANIM_ATTACK_SLASH;break; 24 | case 2: 25 | npc.AnimRange=NPC.AI_ANIM_ATTACK_THRUST;break; 26 | } 27 | 28 | return ActionResult.SUCCESS; 29 | } 30 | 31 | public override void Stop(RAIN.Core.AI ai) 32 | { 33 | base.Stop(ai); 34 | } 35 | } -------------------------------------------------------------------------------- /UnityScripts/AI/Actions/AI_ATTACK_RANDOM.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 446352111bf949c4db8700b78287ed26 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /UnityScripts/AI/Actions/AI_ATTACK_RANGED.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using RAIN.Action; 5 | using RAIN.Core; 6 | 7 | [RAINAction] 8 | public class AI_ATTACK_RANGED : RAINAction 9 | { 10 | public override void Start(RAIN.Core.AI ai) 11 | { 12 | base.Start(ai); 13 | } 14 | 15 | public override ActionResult Execute(RAIN.Core.AI ai) 16 | { 17 | NPC npc= ai.Body.GetComponent(); 18 | npc.ExecuteRangedAttack(); 19 | 20 | return ActionResult.SUCCESS; 21 | } 22 | 23 | public override void Stop(RAIN.Core.AI ai) 24 | { 25 | base.Stop(ai); 26 | } 27 | } -------------------------------------------------------------------------------- /UnityScripts/AI/Actions/AI_ATTACK_SECONDARY.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using RAIN.Action; 5 | using RAIN.Core; 6 | 7 | [RAINAction] 8 | public class AI_ATTACK_SECONDARY : RAINAction 9 | { 10 | public override void Start(RAIN.Core.AI ai) 11 | { 12 | base.Start(ai); 13 | } 14 | 15 | public override ActionResult Execute(RAIN.Core.AI ai) 16 | { 17 | 18 | NPC npc= ai.Body.GetComponent(); 19 | 20 | if ( 21 | (npc.NPC_ID=="70") 22 | || 23 | (npc.NPC_ID=="76") 24 | || 25 | (npc.NPC_ID=="77") 26 | || 27 | (npc.NPC_ID=="78") 28 | )//Only some NPCs have a secondary animation 29 | { 30 | npc.AnimRange=NPC.AI_ANIM_ATTACK_SECONDARY; 31 | } 32 | else 33 | {//Default if not an npc with a secondary 34 | npc.AnimRange=NPC.AI_ANIM_ATTACK_BASH; 35 | } 36 | 37 | return ActionResult.SUCCESS; 38 | } 39 | 40 | public override void Stop(RAIN.Core.AI ai) 41 | { 42 | base.Stop(ai); 43 | } 44 | } -------------------------------------------------------------------------------- /UnityScripts/AI/Actions/AI_ATTACK_SLASH.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using RAIN.Action; 5 | using RAIN.Core; 6 | 7 | [RAINAction] 8 | public class AI_ATTACK_SLASH : RAINAction 9 | { 10 | public override void Start(RAIN.Core.AI ai) 11 | { 12 | base.Start(ai); 13 | } 14 | 15 | public override ActionResult Execute(RAIN.Core.AI ai) 16 | { 17 | NPC npc= ai.Body.GetComponent(); 18 | npc.AnimRange=NPC.AI_ANIM_ATTACK_SLASH; 19 | return ActionResult.SUCCESS; 20 | } 21 | 22 | public override void Stop(RAIN.Core.AI ai) 23 | { 24 | base.Stop(ai); 25 | } 26 | } -------------------------------------------------------------------------------- /UnityScripts/AI/Actions/AI_ATTACK_SLASH.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a024f574b330aad45a8a7c710f1fde29 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /UnityScripts/AI/Actions/AI_ATTACK_THRUST.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using RAIN.Action; 5 | using RAIN.Core; 6 | 7 | [RAINAction] 8 | public class AI_ATTACK_THRUST : RAINAction 9 | { 10 | public override void Start(RAIN.Core.AI ai) 11 | { 12 | base.Start(ai); 13 | } 14 | 15 | public override ActionResult Execute(RAIN.Core.AI ai) 16 | { 17 | NPC npc= ai.Body.GetComponent(); 18 | npc.AnimRange=NPC.AI_ANIM_ATTACK_THRUST; 19 | return ActionResult.SUCCESS; 20 | } 21 | 22 | public override void Stop(RAIN.Core.AI ai) 23 | { 24 | base.Stop(ai); 25 | } 26 | } -------------------------------------------------------------------------------- /UnityScripts/AI/Actions/AI_ATTACK_THRUST.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b822a1a74cca8ff4292a53321389f731 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /UnityScripts/AI/Actions/AI_COMBAT_END.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using RAIN.Action; 5 | using RAIN.Core; 6 | 7 | [RAINAction] 8 | public class AI_COMBAT_END : RAINAction 9 | { 10 | public override void Start(RAIN.Core.AI ai) 11 | { 12 | base.Start(ai); 13 | } 14 | 15 | public override ActionResult Execute(RAIN.Core.AI ai) 16 | { 17 | // NPC npc= ai.Body.GetComponent(); 18 | // npc.npc_attitude=1; 19 | //GoblinAI gob= ai.Body.GetComponent(); 20 | //gob.isHostile=false; 21 | //ai.WorkingMemory.SetItem("isHostile",false); 22 | ai.WorkingMemory.SetItem("state",0); //goto idle states 23 | return ActionResult.SUCCESS; 24 | } 25 | 26 | public override void Stop(RAIN.Core.AI ai) 27 | { 28 | base.Stop(ai); 29 | } 30 | } -------------------------------------------------------------------------------- /UnityScripts/AI/Actions/AI_COMBAT_END.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b3feeae9b56f87c4c9483788a46edb80 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /UnityScripts/AI/Actions/AI_COMBAT_IDLE.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using RAIN.Action; 5 | using RAIN.Core; 6 | 7 | [RAINAction] 8 | public class AI_COMBAT_IDLE : RAINAction 9 | { 10 | public override void Start(RAIN.Core.AI ai) 11 | { 12 | base.Start(ai); 13 | } 14 | 15 | public override ActionResult Execute(RAIN.Core.AI ai) 16 | { 17 | ai.WorkingMemory.SetItem("isMovingRandom",false); 18 | NPC npc= ai.Body.GetComponent(); 19 | npc.AnimRange=NPC.AI_ANIM_COMBAT_IDLE; 20 | 21 | return ActionResult.SUCCESS; 22 | } 23 | 24 | public override void Stop(RAIN.Core.AI ai) 25 | { 26 | base.Stop(ai); 27 | } 28 | } -------------------------------------------------------------------------------- /UnityScripts/AI/Actions/AI_COMBAT_IDLE.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 619915da6b8985d488d45dc2679a768d 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /UnityScripts/AI/Actions/AI_DEATH.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using RAIN.Action; 5 | using RAIN.Core; 6 | 7 | [RAINAction] 8 | public class AI_DEATH : RAINAction 9 | { 10 | public override void Start(RAIN.Core.AI ai) 11 | { 12 | base.Start(ai); 13 | } 14 | 15 | public override ActionResult Execute(RAIN.Core.AI ai) 16 | { 17 | NPC npc = ai.Body.GetComponent(); 18 | npc.AnimRange=NPC.AI_ANIM_DEATH; 19 | //GameObject mus = GameWorldController.instance.mus;//GameObject.Find ("MusicController"); 20 | //if (mus!=null) 21 | //{ 22 | MusicController.LastAttackCounter=0.0f; 23 | GameWorldController.instance.mus.PlaySpecialClip(GameWorldController.instance.mus.VictoryTracks); 24 | 25 | //} 26 | return ActionResult.SUCCESS; 27 | } 28 | 29 | public override void Stop(RAIN.Core.AI ai) 30 | { 31 | base.Stop(ai); 32 | } 33 | } -------------------------------------------------------------------------------- /UnityScripts/AI/Actions/AI_DEATH.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6363bb550539be04caa6c0f324b9bf73 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /UnityScripts/AI/Actions/AI_Destroy.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 223e5941cb2fa854ca8b2eca290d38c1 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /UnityScripts/AI/Actions/AI_IDLE.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using RAIN.Action; 5 | using RAIN.Core; 6 | 7 | [RAINAction] 8 | public class AI_IDLE : RAINAction 9 | { 10 | public override void Start(RAIN.Core.AI ai) 11 | { 12 | base.Start(ai); 13 | } 14 | 15 | public override ActionResult Execute(RAIN.Core.AI ai) 16 | { 17 | ai.WorkingMemory.SetItem("isMovingRandom",false); 18 | NPC npc= ai.Body.GetComponent(); 19 | npc.AnimRange= NPC.AI_RANGE_IDLE; 20 | return ActionResult.SUCCESS; 21 | } 22 | 23 | public override void Stop(RAIN.Core.AI ai) 24 | { 25 | base.Stop(ai); 26 | } 27 | } -------------------------------------------------------------------------------- /UnityScripts/AI/Actions/AI_IDLE.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 26618388a9a24d94e9aa80da7b1bcfb7 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /UnityScripts/AI/Actions/AI_MOVE.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using RAIN.Action; 5 | using RAIN.Core; 6 | 7 | [RAINAction] 8 | public class AI_MOVE : RAINAction 9 | { 10 | public override void Start(RAIN.Core.AI ai) 11 | { 12 | base.Start(ai); 13 | } 14 | 15 | public override ActionResult Execute(RAIN.Core.AI ai) 16 | { 17 | NPC npc= ai.Body.GetComponent(); 18 | npc.AnimRange= NPC.AI_RANGE_MOVE; 19 | return ActionResult.SUCCESS; 20 | } 21 | 22 | public override void Stop(RAIN.Core.AI ai) 23 | { 24 | base.Stop(ai); 25 | } 26 | } -------------------------------------------------------------------------------- /UnityScripts/AI/Actions/AI_MOVE.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 800e27ee327897f469cffbcf4ea0ce99 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /UnityScripts/AI/Actions/AI_MoveToPlayer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f6f49be9f39130741ab79cacc427d58c 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /UnityScripts/AI/Actions/AI_RANDOM_MOVE.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 072481d197c9ae44e98e75525e3aa4e0 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /UnityScripts/AI/Actions/AI_STOP_MOVE.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using RAIN.Action; 5 | using RAIN.Core; 6 | 7 | [RAINAction] 8 | public class AI_STOP_MOVE : RAINAction 9 | { 10 | public override void Start(RAIN.Core.AI ai) 11 | { 12 | base.Start(ai); 13 | } 14 | 15 | public override ActionResult Execute(RAIN.Core.AI ai) 16 | { 17 | //ai.WorkingMemory.GetItem("moveStartPoint"); 18 | ai.WorkingMemory.SetItem("MoveTarget",ai.WorkingMemory.GetItem("moveStartPoint")); 19 | //ai.WorkingMemory.SetItem("isMovingRandom",false); 20 | return ActionResult.SUCCESS; 21 | } 22 | 23 | public override void Stop(RAIN.Core.AI ai) 24 | { 25 | base.Stop(ai); 26 | } 27 | } -------------------------------------------------------------------------------- /UnityScripts/AI/Actions/AI_STOP_MOVE.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f4845f883ea37af4a99b5c539fa4cfa6 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /UnityScripts/AI/Actions/RainAICustomActiontest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 64de96b64faa7af4aa69695bea43cce4 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /UnityScripts/AI/BehaviorTrees/Bragit.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5d7db65ae5aba084198a0ffcd67967a3 3 | NativeFormatImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /UnityScripts/Editor/Test.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2cc866b19392e294aad3d39ba94fd329 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /UnityScripts/Fonts/FONT4X5P.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hankmorgan/UnderworldExporter/64f5c2310e95c2e507725b9c69955e645b80de0b/UnityScripts/Fonts/FONT4X5P.ttf -------------------------------------------------------------------------------- /UnityScripts/Fonts/FONT5X6I.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hankmorgan/UnderworldExporter/64f5c2310e95c2e507725b9c69955e645b80de0b/UnityScripts/Fonts/FONT5X6I.ttf -------------------------------------------------------------------------------- /UnityScripts/Fonts/FONT5X6P.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hankmorgan/UnderworldExporter/64f5c2310e95c2e507725b9c69955e645b80de0b/UnityScripts/Fonts/FONT5X6P.ttf -------------------------------------------------------------------------------- /UnityScripts/Fonts/FontBig.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hankmorgan/UnderworldExporter/64f5c2310e95c2e507725b9c69955e645b80de0b/UnityScripts/Fonts/FontBig.ttf -------------------------------------------------------------------------------- /UnityScripts/Shaders/BasicUWShader.shader: -------------------------------------------------------------------------------- 1 | Shader "BasicUWShader" { 2 | Properties{ 3 | _MainTex("Greyscale (R) Alpha (A)", 2D) = "white" {} 4 | _Color("Main Color", Color) = (1,1,1,1) 5 | } 6 | 7 | SubShader{ 8 | Pass{ 9 | Tags{ "LightMode" = "ForwardAdd" } 10 | Name "BasicUWShader" 11 | CGPROGRAM 12 | 13 | #pragma vertex vert 14 | #pragma fragment frag 15 | #pragma multi_compile_fwdadd_fullshadows 16 | #include "UnityCG.cginc" 17 | #include "AutoLight.cginc" 18 | 19 | struct v2f { 20 | float4 pos : SV_POSITION; 21 | LIGHTING_COORDS(0,1) 22 | float2 uv : TEXCOORD2; 23 | }; 24 | 25 | v2f vert(appdata_tan v) 26 | { 27 | v2f o; 28 | o.pos = UnityObjectToClipPos(v.vertex); 29 | o.uv = v.texcoord.xy; 30 | TRANSFER_VERTEX_TO_FRAGMENT(o); 31 | return o; 32 | } 33 | 34 | sampler2D _MainTex; 35 | 36 | float4 frag(v2f i) : COLOR 37 | { 38 | //float greyscale = tex2D(_MainTex, i.uv).r; 39 | float4 result; 40 | result.rgb = tex2D(_MainTex, i.uv).rgb; //tex2D(_ColorPaletteIn, float2(greyscale, 0.1)).rgb; 41 | result.a = tex2D(_MainTex, i.uv).a; 42 | //return result; 43 | return result *LIGHT_ATTENUATION(i); 44 | } 45 | ENDCG 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /UnityScripts/Shaders/ColourReplacement.shader: -------------------------------------------------------------------------------- 1 | // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' 2 | 3 | Shader "ColourReplacement" { 4 | Properties{ 5 | _MainTex("Greyscale (R) Alpha (A)", 2D) = "white" {} 6 | _Color("Main Color", Color) = (1,1,1,1) 7 | } 8 | 9 | SubShader{ 10 | Pass{ 11 | Tags{ "LightMode" = "ForwardAdd" } 12 | Name "ColorReplacementPass" 13 | CGPROGRAM 14 | 15 | #pragma vertex vert 16 | #pragma fragment frag 17 | #pragma multi_compile_fwdadd_fullshadows 18 | #include "UnityCG.cginc" 19 | #include "AutoLight.cginc" 20 | 21 | struct v2f { 22 | float4 pos : SV_POSITION; 23 | LIGHTING_COORDS(0,1) 24 | float2 uv : TEXCOORD2; 25 | }; 26 | 27 | v2f vert(appdata_tan v) 28 | { 29 | v2f o; 30 | o.pos = UnityObjectToClipPos(v.vertex); 31 | o.uv = v.texcoord.xy; 32 | TRANSFER_VERTEX_TO_FRAGMENT(o); 33 | return o; 34 | } 35 | 36 | sampler2D _MainTex; 37 | sampler2D _ColorPaletteIn; 38 | 39 | float4 frag(v2f i) : COLOR 40 | { 41 | float greyscale = tex2D(_MainTex, i.uv).r; 42 | float4 result; 43 | result.rgb = tex2D(_ColorPaletteIn, float2(greyscale, 0.1)).rgb; 44 | result.a = tex2D(_MainTex, i.uv).a; 45 | //return result; 46 | return result * LIGHT_ATTENUATION(i); 47 | } 48 | ENDCG 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /UnityScripts/scripts/Actions/Action_Activate.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class Action_Activate : MonoBehaviour { 5 | 6 | public string[] ObjectsToActivate=new string[4]; 7 | public int[] ActivationDelay=new int[4]; 8 | 9 | public void PerformAction() 10 | { 11 | Debug.Log (this.name + " Action Activate"); 12 | for (int i = 0; i<4; i++) 13 | { 14 | if (ObjectsToActivate[i]!="") 15 | { 16 | GameObject objToActivate = GameObject.Find (ObjectsToActivate[i]); 17 | if (objToActivate!=null) 18 | { 19 | if (ActivationDelay[i]!=0) 20 | { 21 | StartCoroutine(ActivationWait (objToActivate,ActivationDelay[i])); 22 | } 23 | else 24 | { 25 | objToActivate.SendMessage("Activate"); 26 | } 27 | } 28 | } 29 | } 30 | } 31 | 32 | IEnumerator ActivationWait(GameObject objToActivate, float waittime) 33 | { 34 | //Debug.Log("MoveTileStart"); 35 | float index = 0.0f; 36 | while (index (); 14 | if (aus!=null) 15 | { 16 | aus.clip=Message; 17 | aus.Play(); 18 | } 19 | Debug.Log ("Action Message"); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Actions/Action_Radaway.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class Action_Radaway : MonoBehaviour { 5 | 6 | public void PerformAction() 7 | { 8 | Debug.Log ("Action Radaway"); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Actions/Action_Resurrection.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class Action_Resurrection : MonoBehaviour { 5 | 6 | public void PerformAction() 7 | { 8 | Debug.Log ("Action Ressurection"); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Actions/Action_Set_Variable.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class Action_Set_Variable : MonoBehaviour { 5 | 6 | public void PerformAction() 7 | { 8 | Debug.Log ("Action Set Variable"); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Actions/Action_Spawn.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class Action_Spawn : MonoBehaviour { 5 | 6 | public void PerformAction() 7 | { 8 | Debug.Log ("Action Spawn"); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Actions/Action_Timer.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class Action_Timer : MonoBehaviour { 5 | 6 | public void PerformAction() 7 | { 8 | Debug.Log ("Action Timer"); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Actions/Action_Transport_Level.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class Action_Transport_Level : MonoBehaviour { 5 | 6 | public void PerformAction() 7 | { 8 | Debug.Log ("Action Transport Level"); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Cutscenes/Cutscene_AllWhoOppose.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class Cutscene_AllWhoOppose : Cutscene_GuardianTaunts { 6 | 7 | 8 | public override void Awake() 9 | { 10 | base.Awake(); 11 | InitGuardianTaunt("cs037_n01", 3078, "BSP07.VOC"); 12 | } 13 | 14 | 15 | } 16 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Cutscenes/Cutscene_Arial.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class Cutscene_Arial : Cuts { 5 | 6 | public override void Awake() 7 | { 8 | base.Awake(); 9 | noOfImages=3; 10 | 11 | ImageFrames[0] = "cs003_n01";//arial talking 12 | ImageTimes[0]=0.0f; 13 | ImageLoops[0]=-1; 14 | 15 | ImageFrames[1] = "cs003_n02";//arial talking 16 | ImageTimes[1]=7f; 17 | ImageLoops[1]=-1; 18 | 19 | ImageFrames[2]="Anim_Base";//To finish. 20 | ImageTimes[2] = 13.0f; 21 | ImageLoops[2] = -1; 22 | 23 | 24 | StringBlockNo=3075; 25 | noOfSubs=4; 26 | 27 | for (int i=0; i< 4; i++) 28 | { 29 | SubsStringIndices[i]=i; 30 | SubsTimes[i]= i*3.0f; 31 | SubsDuration[i]=2.5f; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Cutscenes/Cutscene_Credits.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class Cutscene_Credits : Cuts { 5 | 6 | public override void Awake() 7 | { 8 | base.Awake(); 9 | noOfImages=2; 10 | ImageTimes[0]=0.0f; 11 | ImageTimes[1]=42.0f; 12 | 13 | ImageFrames[0]="cs012_n01"; 14 | ImageFrames[1]="Anim_Base";//To finish. 15 | 16 | ImageLoops[0]=-1; 17 | ImageLoops[1]=-1; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Cutscenes/Cutscene_Dream_1.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class Cutscene_Dream_1 : Cuts { 5 | 6 | public override void Awake() 7 | { 8 | base.Awake(); 9 | noOfImages=4; 10 | ImageFrames[0] = "cs000_n06";//Fade in Garamon 11 | ImageTimes[0] = 0f; 12 | ImageLoops[0] = -1; 13 | 14 | ImageFrames[1] = "cs000_n03";//Garamon speaks 15 | ImageTimes[1] = 7.0f; 16 | ImageLoops[1] = -1; 17 | 18 | ImageFrames[2] = "cs000_n03";//Garamon speaks 19 | ImageTimes[2] = 14.0f; 20 | ImageLoops[2] = -1; 21 | 22 | ImageFrames[3]="Anim_Base";//To finish. 23 | ImageTimes[3] = 25.2f; 24 | ImageLoops[3] = -1; 25 | 26 | 27 | 28 | StringBlockNo=3096; 29 | noOfSubs=3; 30 | for (int i=0;i 4 | /// Cutscene dream 7. Tybal is dead. (Swapped with dream 8) 5 | /// 6 | public class Cutscene_Dream_7 : Cuts { 7 | 8 | public override void Awake() 9 | { 10 | base.Awake(); 11 | noOfImages=4; 12 | ImageFrames[0] = "cs000_n06";//Fade in Garamon 13 | ImageTimes[0] = 0f; 14 | ImageLoops[0] = -1; 15 | 16 | ImageFrames[1] = "cs000_n03";//Garamon speaks 17 | ImageTimes[1] = 6.0f; 18 | ImageLoops[1] = -1; 19 | 20 | ImageFrames[2] = "cs000_n03";//Garamon speaks 21 | ImageTimes[2] = 13.0f; 22 | ImageLoops[2] = -1; 23 | 24 | ImageFrames[3]="Anim_Base";//To finish. 25 | ImageTimes[3] = 48f; 26 | ImageLoops[3] = -1; 27 | 28 | 29 | 30 | StringBlockNo=3098;//was 3104 31 | noOfSubs=9; 32 | for (int i=0;i 5 | /// Class for storing event actions 6 | /// 7 | public class event_action : UWClass { 8 | 9 | 10 | //OBSOLETE 11 | 12 | 13 | 14 | /* 15 | 16 | /// 17 | /// The tile x to fire scheduled triggers on 18 | /// 19 | public int EventTileX=0; 20 | 21 | /// 22 | /// The tile y to fire scheduled triggers on. 23 | /// 24 | public int EventTileY=0; 25 | 26 | /// 27 | /// The variable or quest no to test 28 | /// 29 | public int event_variable=0; 30 | 31 | /// 32 | /// The the condition a quest variable or a regular variable. 33 | /// 34 | public bool event_isQuest=false; 35 | 36 | /// 37 | /// The race or whoami that will be affected by this trigger 38 | /// 39 | public int WhoAmIOrRace; 40 | 41 | /// 42 | /// The event affects a named Npc rather than a race 43 | /// 44 | public bool isWhoAmi; 45 | 46 | */ 47 | 48 | 49 | } -------------------------------------------------------------------------------- /UnityScripts/scripts/Events/event_always.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | /// 4 | /// Variant of the event trigger that will run regardless of the execution flag. 5 | /// 6 | public class event_always : event_base { 7 | 8 | 9 | public override void Process () 10 | { 11 | if (CheckCondition()) 12 | { 13 | ExecuteEvent(); 14 | } 15 | } 16 | 17 | public override string EventName() 18 | { 19 | return "event_always"; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Events/event_fire_triggers.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class event_fire_triggers : event_base 5 | { 6 | 7 | //Fires any type of trigger at the specified tiles 8 | 9 | public override void ExecuteEvent() 10 | { 11 | base.ExecuteEvent(); 12 | int eventTileX = RawData[3]; 13 | int eventTileY = RawData[4]; 14 | 15 | ObjectLoaderInfo[] objList = CurrentObjectList().objInfo; 16 | for (int o = 256; o <= objList.GetUpperBound(0); o++) 17 | { 18 | if ((objList[o].ObjectTileX == eventTileX) && (objList[o].ObjectTileY == eventTileY) && (objList[o].instance != null)) 19 | { 20 | if (ObjectLoader.isTrigger(objList[o])) 21 | { 22 | objList[o].instance.GetComponent().Activate(UWCharacter.Instance.gameObject); 23 | } 24 | } 25 | } 26 | } 27 | 28 | public override string EventName() 29 | { 30 | return "Fire_Trigger"; 31 | } 32 | 33 | public override string summary() 34 | { 35 | return base.summary() + "\n\t\tTileX=" + (int)RawData[3] + ",TileY=" + (int)RawData[4]; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Events/event_kill_npc.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class event_kill_npc : event_base { 5 | //Take a guess. 6 | 7 | 8 | public override void ExecuteEvent () 9 | { 10 | base.ExecuteEvent(); 11 | int WhoAmI = RawData[4]; 12 | NPC[] npc = findNPC(WhoAmI); 13 | if (npc!=null) 14 | { 15 | for (int i=0; i<=npc.GetUpperBound(0);i++) 16 | { 17 | npc[i].npc_hp=-1;//Force death in next frame 18 | } 19 | } 20 | } 21 | 22 | public override string EventName() 23 | { 24 | return "Kill_NPC"; 25 | } 26 | 27 | public override string summary() 28 | { 29 | return base.summary() + "\n\t\tWhoAmI=" + (int)RawData[4]; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Events/event_kill_npc_or_race.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class event_kill_npc_or_race : event_base { 5 | 6 | 7 | public override void ExecuteEvent () 8 | { 9 | base.ExecuteEvent(); 10 | NPC[] npcs=null; 11 | bool isNPC = (RawData[5]==1); 12 | if (isNPC) 13 | { 14 | int WhoAmI = RawData[4]; 15 | npcs = findNPC(WhoAmI); 16 | } 17 | else 18 | { 19 | int race=RawData[4]; 20 | npcs=findRace(race); 21 | } 22 | if (npcs!=null) 23 | { 24 | for (int i=0; i<=npcs.GetUpperBound(0);i++) 25 | { 26 | npcs[i].npc_hp=-1; 27 | } 28 | } 29 | } 30 | 31 | public override string EventName() 32 | { 33 | return "Kill_NPC_Or_Race"; 34 | } 35 | 36 | public override string summary() 37 | { 38 | bool isNPC = (RawData[5] == 1); 39 | if (isNPC) 40 | { 41 | return base.summary() + "\n\t\tIsNPC=" + (int)RawData[5] + ",WhoAmI=" + (int)RawData[4]; 42 | } 43 | else 44 | { 45 | return base.summary() + "\n\t\tIsNPC=" + (int)RawData[5] + ",Race=" + (int)RawData[4]; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Events/event_move_npc.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class event_move_npc : event_base { 5 | 6 | //Moves an NPC to a specified tileX & tile Y 7 | //Not sure how this should differ from placenpc event 8 | 9 | public override void ExecuteEvent () 10 | { 11 | base.ExecuteEvent(); 12 | int tileX=RawData[3]; 13 | int tileY=RawData[4]; 14 | int WhoAmI= RawData[6]; 15 | Vector3 pos = CurrentTileMap().getTileVector(tileX,tileY); 16 | 17 | NPC[] npc = findNPC(WhoAmI); 18 | if (npc!=null) 19 | { 20 | for (int i=0; i<=npc.GetUpperBound(0);i++) 21 | { 22 | npc[i].transform.position=pos; 23 | npc[i].npc_xhome=(short)tileX; 24 | npc[i].npc_yhome=(short)tileY; 25 | } 26 | } 27 | } 28 | 29 | public override string EventName() 30 | { 31 | return "Move_NPC"; 32 | } 33 | 34 | public override string summary() 35 | { 36 | return base.summary() + "\n\t\tTileX=" + (int)RawData[3] + ",TileY=" + (int)RawData[4] +"WhoAmI=" + (int)RawData[6]; 37 | } 38 | } 39 | 40 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Events/event_place_npc.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class event_place_npc : event_move_npc { 5 | 6 | 7 | public override string EventName() 8 | { 9 | return "place_npc"; 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Events/event_remove_npc.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class event_remove_npc : event_base { 5 | 6 | //Removes an npc from the game world but does not kill them 7 | 8 | public override void ExecuteEvent () 9 | { 10 | base.ExecuteEvent(); 11 | int WhoAmI=RawData[4]; 12 | NPC[] npc = findNPC(WhoAmI); 13 | if (npc!=null) 14 | { 15 | for (int i=0; i<=npc.GetUpperBound(0);i++) 16 | { 17 | npc[i].gameObject.transform.position = UWCharacter.Instance.playerInventory.InventoryMarker.transform.position; 18 | } 19 | } 20 | } 21 | 22 | public override string EventName() 23 | { 24 | return "Remove_NPC"; 25 | } 26 | 27 | public override string summary() 28 | { 29 | return base.summary() + "\n\t\tWhoAmI=" + (int)RawData[4]; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Events/event_scheduled.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class event_scheduled : event_base 5 | { 6 | //AN event that fires a scheduled trigger in the specified tile X & Y 7 | 8 | public override void ExecuteEvent() 9 | { 10 | base.ExecuteEvent(); 11 | int eventTileX = RawData[3]; 12 | int eventTileY = RawData[4]; 13 | 14 | ObjectLoaderInfo[] objList = CurrentObjectList().objInfo; 15 | for (int o = 256; o <= objList.GetUpperBound(0); o++) 16 | { 17 | if ((objList[o].ObjectTileX == eventTileX) && (objList[o].ObjectTileY == eventTileY) && (objList[o].instance != null)) 18 | { 19 | if (objList[o].instance.GetItemType() == ObjectInteraction.A_SCHEDULED_TRIGGER) 20 | { 21 | objList[o].instance.GetComponent().Activate(null); 22 | } 23 | } 24 | } 25 | } 26 | 27 | public override string EventName() 28 | { 29 | return "event_scheduled"; 30 | } 31 | 32 | public override string summary() 33 | { 34 | return base.summary() + "\n\t\tTileX=" + (int)RawData[3] + ",TileY=" + (int)RawData[4]; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Events/event_set_goal_alt.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class event_set_goal_alt : event_set_goal { 5 | 6 | public override void Process () 7 | { 8 | if (Executing) 9 | { 10 | base.Process(); 11 | } 12 | } 13 | 14 | public override string EventName() 15 | { 16 | return "set_goal_alt"; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Events/event_set_race_attitude.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class event_set_race_attitude : event_base { 5 | //Set the attitude of a race towards you. 6 | 7 | public override void ExecuteEvent () 8 | { 9 | base.ExecuteEvent(); 10 | int Race=RawData[4]; 11 | int newAttitude = RawData[5]; 12 | 13 | NPC[] npcs =findRace(Race); 14 | if (npcs!=null) 15 | { 16 | for (int i=0; i<=npcs.GetUpperBound(0);i++) 17 | { 18 | npcs[i].npc_attitude=(short)newAttitude; 19 | } 20 | } 21 | } 22 | 23 | public override string EventName() 24 | { 25 | return "set_race_attitude"; 26 | } 27 | 28 | public override string summary() 29 | { 30 | return base.summary() + "\n\t\tRace=" + (int)RawData[4] + ",Attitude=" + (int)RawData[5]; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Loaders/CritterAnimInfo.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class CritterAnimInfo { 5 | public const int NoOfAnims=44; 6 | public string[,] animSequence; 7 | public int[,] animIndices; 8 | //public ArtLoader.RawImageData[,] animSprites; 9 | public Sprite[] animSprites; 10 | public string[] animName; 11 | 12 | public CritterAnimInfo() 13 | { 14 | animSequence=new string[NoOfAnims,8]; 15 | animIndices=new int[NoOfAnims,8]; 16 | switch (Loader._RES) 17 | { 18 | case Loader.GAME_UW2: 19 | animSprites=new Sprite[180]; 20 | break; 21 | default: 22 | animSprites=new Sprite[128]; 23 | break; 24 | } 25 | animName=new string[NoOfAnims]; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Loaders/XFerLoader.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class XFerLoader : Loader { 6 | public char[] auxPalVal; //= //new char[5,32]; 7 | //When aux pal is the following 8 | // 0xf0 fade to red 9 | // 0xf4 fade to blue 10 | // 0xf8 fade to green 11 | // ???? fade to white 12 | //???? fade to black 13 | 14 | // 0x0080 fade to red 15 | // 0x0100 fade to green 16 | //0x0180 fade to blue 17 | // 0x0200 fade to white 18 | // 0x0280 fade to black 19 | 20 | public XFerLoader() 21 | { 22 | // char[] pal_file; 23 | Path = Loader.BasePath + "\\data\\xfer.dat"; 24 | 25 | if (DataLoader.ReadStreamFile(Path, out auxPalVal)) 26 | { 27 | /*for (int a = 0; a <= auxPalVal.GetUpperBound(0); a++) 28 | { 29 | for (int i = 0; i < 32; i++) 30 | { 31 | //auxPalVal[a, i] = (char)DataLoader.getValAtAddress(pal_file, 0x80 + a * 32 + i, 8); 32 | } 33 | }*/ 34 | } 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellEffects/SpellEffectAccuracy.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class SpellEffectAccuracy : SpellEffect { 5 | 6 | //The weapon is more accurate. 7 | 8 | } 9 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellEffects/SpellEffectBounce.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class SpellEffectBounce : SpellEffect { 6 | public override void ApplyEffect () 7 | { 8 | if (UWCharacter.Instance==null) 9 | { 10 | UWCharacter.Instance= this.GetComponent(); 11 | } 12 | UWCharacter.Instance.isBouncy=true; 13 | base.ApplyEffect (); 14 | } 15 | 16 | 17 | void Update() 18 | { 19 | if (Active) 20 | {//Maintain the effect 21 | UWCharacter.Instance.isBouncy=true; 22 | } 23 | } 24 | 25 | public override void CancelEffect () 26 | { 27 | UWCharacter.Instance.isBouncy=false; 28 | base.CancelEffect (); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellEffects/SpellEffectCurse.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class SpellEffectCurse : SpellEffect { 5 | 6 | //What does this do? Reduce defences? 7 | public bool isNPC; 8 | //Curse NPC version. See spelleffectluck for effect on player 9 | } 10 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellEffects/SpellEffectDamage.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class SpellEffectDamage : SpellEffect { 5 | 6 | //The weapon causes more damage. 7 | } 8 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellEffects/SpellEffectFlameproof.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | /// 4 | /// Player becomes fireproof. 5 | /// 6 | public class SpellEffectFlameproof : SpellEffectImmunity { 7 | 8 | /*public override void ApplyEffect () 9 | { 10 | UWCharacter.Instance.FireProof=true; 11 | base.ApplyEffect (); 12 | } 13 | 14 | void Update() 15 | { 16 | UWCharacter.Instance.FireProof=true; 17 | } 18 | 19 | public override void CancelEffect () 20 | { 21 | UWCharacter.Instance.FireProof=false; 22 | base.CancelEffect (); 23 | }*/ 24 | 25 | } 26 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellEffects/SpellEffectImmunity.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | /// 5 | /// Makes the character immunity to a certain status effects and damage types. 6 | /// 7 | public class SpellEffectImmunity : SpellEffect { 8 | 9 | 10 | } 11 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellEffects/SpellEffectImmunityPoison.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class SpellEffectImmunityPoison : SpellEffectImmunity { 5 | 6 | //Won't cure existing poisoning. Just prevents it from being applied. 7 | //TODO:Move Poisoning to an api to enforce this behaviour. 8 | } 9 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellEffects/SpellEffectLeap.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | /// 4 | /// Makes you jump higher. 5 | /// 6 | public class SpellEffectLeap : SpellEffect { 7 | 8 | public override void ApplyEffect () 9 | { 10 | if (UWCharacter.Instance==null) 11 | { 12 | UWCharacter.Instance= this.GetComponent(); 13 | } 14 | UWCharacter.Instance.isLeaping=true; 15 | base.ApplyEffect (); 16 | } 17 | 18 | 19 | void Update() 20 | { 21 | if (Active) 22 | {//Maintain the effect 23 | UWCharacter.Instance.isLeaping=true; 24 | } 25 | } 26 | 27 | public override void CancelEffect () 28 | { 29 | UWCharacter.Instance.isLeaping=false; 30 | base.CancelEffect (); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellEffects/SpellEffectLight.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | /// 4 | /// Creates a light source around the player 5 | /// 6 | public class SpellEffectLight : SpellEffect { 7 | 8 | public override void ApplyEffect () 9 | { 10 | if (LightSource.MagicBrightness(); 14 | } 15 | UWCharacter.Instance.isLucky = NewState; 16 | base.ApplyEffect(); 17 | } 18 | 19 | 20 | //void Update() 21 | //{ 22 | // if (Active) 23 | // {//Maintain the effect 24 | // UWCharacter.Instance.isLucky = true; 25 | // } 26 | //} 27 | 28 | public override void CancelEffect() 29 | { 30 | UWCharacter.Instance.isLucky = UWCharacter.LuckState.Neutral; 31 | base.CancelEffect(); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellEffects/SpellEffectMagicResistant.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class SpellEffectMagicResistant : MonoBehaviour { 6 | 7 | // Use this for initialization 8 | void Start () { 9 | 10 | } 11 | 12 | // Update is called once per frame 13 | void Update () { 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellEffects/SpellEffectNightVision.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using UnityStandardAssets.ImageEffects; 4 | /// 5 | /// Add a Greyscale effect to the player vision. 6 | /// Increases the light range 7 | /// 8 | public class SpellEffectNightVision : SpellEffectLight { 9 | public static bool inUse; 10 | public Grayscale gs; 11 | 12 | public override void ApplyEffect () 13 | { 14 | if (inUse==false) 15 | { 16 | gs = Camera.main.gameObject.AddComponent(); 17 | //gs.shader=Shader.Find ("Hidden/Grayscale Effect"); 18 | gs.shader=GameWorldController.instance.greyScale; 19 | } 20 | 21 | base.ApplyEffect (); 22 | } 23 | 24 | public override void Update () 25 | { 26 | if (Active) 27 | { 28 | inUse=true; 29 | } 30 | base.Update (); 31 | } 32 | 33 | public override void CancelEffect () 34 | { 35 | if (gs!=null) 36 | { 37 | Destroy (gs); 38 | } 39 | inUse=false; 40 | base.CancelEffect (); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellEffects/SpellEffectPetrified.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class SpellEffectPetrified : SpellEffect { 6 | 7 | private NPC npc; 8 | 9 | 10 | public override void ApplyEffect() 11 | { 12 | base.ApplyEffect(); 13 | npc = this.GetComponent(); 14 | TickTime = 1;//Realtime counter 15 | npc.npc_goal = (short)NPC.npc_goals.npc_goal_petrified; 16 | npc.npc_gtarg = counter; 17 | npc.newAnim.FreezeAnimFrame = true; 18 | npc.newAnim.output.color = Color.gray; 19 | } 20 | 21 | public override void EffectOverTime() 22 | { 23 | base.EffectOverTime(); 24 | npc.npc_gtarg = counter; 25 | } 26 | 27 | public override void CancelEffect() 28 | { 29 | npc.npc_goal = (short)NPC.npc_goals.npc_goal_attack_5; 30 | npc.npc_gtarg = 0; 31 | npc.newAnim.FreezeAnimFrame = false; 32 | npc.newAnim.output.color = Color.white; 33 | base.CancelEffect(); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellEffects/SpellEffectProtection.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | /// 4 | /// The armour/weapon provides more protection. 5 | /// 6 | public class SpellEffectProtection : SpellEffect { 7 | 8 | 9 | } 10 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellEffects/SpellEffectRegeneration.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class SpellEffectRegeneration : SpellEffect { 6 | 7 | ///The amount of regen per counter tick. 8 | public int DOT; 9 | 10 | public override void ApplyEffect () 11 | { 12 | DOT=Value/counter; 13 | base.ApplyEffect (); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellEffects/SpellEffectRegenerationHealth.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | /// 4 | /// Regenerates Health 5 | /// 6 | public class SpellEffectRegenerationHealth : SpellEffectRegeneration { 7 | 8 | public override void EffectOverTime () 9 | { 10 | base.EffectOverTime (); 11 | UWCharacter.Instance.CurVIT=UWCharacter.Instance.CurVIT+DOT; 12 | if (UWCharacter.Instance.CurVIT>=UWCharacter.Instance.MaxVIT) 13 | { 14 | UWCharacter.Instance.CurVIT=UWCharacter.Instance.MaxVIT; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellEffects/SpellEffectRegenerationMana.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | /// 4 | /// Mana regeneration 5 | /// 6 | public class SpellEffectRegenerationMana : SpellEffectRegeneration { 7 | 8 | 9 | public override void EffectOverTime () 10 | { 11 | base.EffectOverTime (); 12 | UWCharacter.Instance.PlayerMagic.CurMana=UWCharacter.Instance.PlayerMagic.CurMana+DOT; 13 | if (UWCharacter.Instance.PlayerMagic.CurMana>=UWCharacter.Instance.PlayerMagic.MaxMana) 14 | { 15 | UWCharacter.Instance.PlayerMagic.CurMana=UWCharacter.Instance.PlayerMagic.MaxMana; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellEffects/SpellEffectResistance.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | /// 4 | /// For iron skin, thick skin and resist blows etc that modify damage resistance. (only the strongest applies) 5 | /// 6 | public class SpellEffectResistance : SpellEffect { 7 | 8 | public override void ApplyEffect () 9 | { 10 | UWCharacter.Instance.Resistance=Value; 11 | base.ApplyEffect (); 12 | } 13 | 14 | public override void CancelEffect () 15 | { 16 | UWCharacter.Instance.Resistance=0; 17 | base.CancelEffect (); 18 | } 19 | 20 | void Update() 21 | {//Keeps the value at it's highest possible 22 | if (Active) 23 | { 24 | if (UWCharacter.Instance.Resistance 4 | /// Allows the user to explore the level from above it. 5 | /// 6 | public class SpellEffectRoamingSight : SpellEffect { 7 | public int OldMana; 8 | public Vector3 OldPosition; 9 | 10 | /// 11 | /// Moves the player above the map. Records their position 12 | /// 13 | public override void ApplyEffect () 14 | { 15 | UWCharacter.Instance.isRoaming=true; 16 | OldMana=UWCharacter.Instance.PlayerMagic.CurMana; 17 | UWCharacter.Instance.PlayerMagic.CurMana=0; 18 | OldPosition = UWCharacter.Instance.transform.position; 19 | UWCharacter.Instance.transform.position=new Vector3(OldPosition.x,5.5f,OldPosition.z); 20 | base.ApplyEffect(); 21 | } 22 | 23 | /// 24 | /// Moves the player back to where they cancelled the spell from 25 | /// 26 | public override void CancelEffect () 27 | { 28 | UWCharacter.Instance.isRoaming=false; 29 | UWCharacter.Instance.transform.position=OldPosition; 30 | UWCharacter.Instance.PlayerMagic.CurMana=OldMana; 31 | base.CancelEffect(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellEffects/SpellEffectSlowFall.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | /// 5 | /// Slow fall. 6 | /// 7 | public class SpellEffectSlowFall : SpellEffect { 8 | 9 | public override void ApplyEffect () 10 | { 11 | base.ApplyEffect (); 12 | UWCharacter.Instance.isFloating=true; 13 | } 14 | 15 | void Update() 16 | { 17 | if (Active==true) 18 | {//Make sure the effect is continually applied. 19 | UWCharacter.Instance.isFloating=true; 20 | } 21 | } 22 | 23 | public override void CancelEffect () 24 | { 25 | UWCharacter.Instance.isFloating=false; 26 | base.CancelEffect (); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellEffects/SpellEffectSpeed.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | /// 4 | /// Makes the player move fast. 5 | /// 6 | public class SpellEffectSpeed : SpellEffect { 7 | 8 | ///How much the players motion is increased by 9 | public float speedMultiplier; 10 | 11 | public override void ApplyEffect () 12 | { 13 | UWCharacter.Instance.speedMultiplier=speedMultiplier; 14 | UWCharacter.Instance.isSpeeding=true; 15 | base.ApplyEffect (); 16 | } 17 | 18 | void Update() 19 | { 20 | if(Active) 21 | { 22 | UWCharacter.Instance.speedMultiplier=speedMultiplier; 23 | UWCharacter.Instance.isSpeeding=true; 24 | } 25 | } 26 | 27 | public override void CancelEffect () 28 | { 29 | UWCharacter.Instance.speedMultiplier=1.0f; 30 | UWCharacter.Instance.isSpeeding=false; 31 | base.CancelEffect (); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellEffects/SpellEffectStealth.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | /// 4 | /// Player stealth and invisibility 5 | /// 6 | public class SpellEffectStealth : SpellEffect { 7 | //Unimplemented. 8 | /// 9 | /// The stealth level the spell provides 10 | /// 11 | public int StealthLevel; 12 | 13 | public override void ApplyEffect () 14 | { 15 | base.ApplyEffect(); 16 | //UWCharacter.Instance.DetectionRange=6-StealthLevel; 17 | UWCharacter.Instance.StealthLevel= Mathf.Max(StealthLevel,UWCharacter.Instance.StealthLevel); 18 | } 19 | 20 | public override void CancelEffect () 21 | { 22 | base.CancelEffect (); 23 | //UWCharacter.Instance.DetectionRange=6; 24 | //Cancel the players stealth rating if this is the only stealth effect active. 25 | UWCharacter.Instance.StealthLevel=0; 26 | } 27 | 28 | void Update() 29 | {//Keep the effect applied. 30 | if (Active) 31 | { 32 | //UWCharacter.Instance.DetectionRange=6-StealthLevel; 33 | UWCharacter.Instance.StealthLevel= Mathf.Max(StealthLevel,UWCharacter.Instance.StealthLevel); 34 | } 35 | } 36 | 37 | 38 | 39 | 40 | } 41 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellEffects/SpellEffectTelekinesis.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | /// 4 | /// Interact objects at a distance 5 | /// 6 | public class SpellEffectTelekinesis : SpellEffect { 7 | 8 | public override void ApplyEffect () 9 | { 10 | base.ApplyEffect(); 11 | UWCharacter.Instance.isTelekinetic=true; 12 | } 13 | 14 | public override void CancelEffect () 15 | { 16 | base.CancelEffect (); 17 | UWCharacter.Instance.isTelekinetic=false; 18 | } 19 | 20 | void Update() 21 | {//Keep the effect applied. 22 | if (Active) 23 | { 24 | UWCharacter.Instance.isTelekinetic=true; 25 | } 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellEffects/SpellEffectToughness.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | /// 4 | /// Make a weapon/armour more resistant to losing durabilty. 5 | /// 6 | public class SpellEffectToughness : SpellEffect { 7 | 8 | } 9 | 10 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellEffects/SpellEffectWaterWalk.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | /// 4 | /// Allows the player to walk on water 5 | /// 6 | public class SpellEffectWaterWalk : SpellEffect { 7 | 8 | 9 | void Update() 10 | { 11 | if (Active) 12 | { 13 | UWCharacter.Instance.isWaterWalking=true; 14 | } 15 | } 16 | 17 | public override void ApplyEffect () 18 | { 19 | 20 | if (UWCharacter.Instance==null) 21 | { 22 | UWCharacter.Instance= this.GetComponent(); 23 | } 24 | UWCharacter.Instance.isWaterWalking=true; 25 | 26 | base.ApplyEffect(); 27 | } 28 | 29 | public override void CancelEffect () 30 | { 31 | UWCharacter.Instance.isWaterWalking=false; 32 | base.CancelEffect(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellProperties/SpellProp_Acid.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class SpellProp_Acid : SpellProp { 5 | 6 | 7 | 8 | public override void init(int effectId, GameObject SpellCaster) 9 | { 10 | base.init (effectId,SpellCaster); 11 | ProjectileItemId=22; 12 | Force=200.0f; 13 | BaseDamage=3; 14 | impactFrameStart=46; 15 | impactFrameEnd=50; 16 | spread=0; 17 | noOfCasts=1; 18 | silent=true;//no sound 19 | damagetype = DamageTypes.acid; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellProperties/SpellProp_Bounce.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class SpellProp_Bounce : SpellProp { 6 | 7 | public override void init (int effectId, GameObject SpellCaster) 8 | { 9 | counter=3; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellProperties/SpellProp_Curse.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class SpellProp_Curse : SpellProp { 5 | 6 | //What does this spell do? 7 | 8 | 9 | public override void init (int effectId, GameObject SpellCaster) 10 | { 11 | base.init (effectId,SpellCaster); 12 | counter=10; 13 | impactFrameStart=40; 14 | impactFrameEnd=44; 15 | damagetype = DamageTypes.psychic; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellProperties/SpellProp_DirectDamage.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class SpellProp_DirectDamage : SpellProp { 5 | 6 | 7 | //Direct impact spells no projectile 8 | 9 | public override void init (int effectId, GameObject SpellCaster) 10 | { 11 | base.init (effectId,SpellCaster); 12 | switch(effectId) 13 | { 14 | case SpellEffect.UW1_Spell_Effect_SmiteUndead: 15 | case SpellEffect.UW1_Spell_Effect_SmiteUndead_alt01: 16 | BaseDamage=100;//Instant kill undead? 17 | break; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellProperties/SpellProp_ElectricBolt.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class SpellProp_ElectricBolt : SpellProp { 5 | //Electric bolt 6 | public override void init(int effectId, GameObject SpellCaster) 7 | { 8 | base.init (effectId,SpellCaster); 9 | //ProjectileSprite = UWEBase._RES +"/Sprites/Objects/Objects_021"; 10 | ProjectileItemId=21; 11 | Force=200.0f; 12 | BaseDamage=8; 13 | impactFrameStart=46; 14 | impactFrameEnd=50; 15 | damagetype = DamageTypes.electric; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellProperties/SpellProp_FlameWind.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class SpellProp_FlameWind : SpellProp_Fireball { 5 | //Flame wind. Aka DOOM. 6 | 7 | public override void init(int effectId, GameObject SpellCaster) 8 | { 9 | 10 | base.init (effectId,SpellCaster); 11 | //ProjectileSprite = UWEBase._RES +"/Sprites/object_blank"; 12 | ProjectileItemId=20;//TODO:WHat do I do here?? There is no projectile. 13 | Force=500.0f; 14 | BaseDamage=16; 15 | splashDamage=8; 16 | splashDistance=1.0f; 17 | impactFrameStart=21; 18 | impactFrameEnd=25; 19 | spread=5; 20 | noOfCasts=Random.Range(2,5); 21 | SecondaryStartFrame=31; 22 | SecondaryEndFrame=35; 23 | damagetype = DamageTypes.fire; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellProperties/SpellProp_Homing.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class SpellProp_Homing : SpellProp { 6 | //Homing missile used in deadly seeker spell 7 | public MagicProjectile projectileToTrack; 8 | 9 | public override void init(int effectId, GameObject SpellCaster) 10 | { 11 | base.init (effectId,SpellCaster); 12 | ProjectileItemId=27; 13 | Force=200.0f; 14 | BaseDamage=12; 15 | impactFrameStart=43; 16 | impactFrameEnd=47; 17 | spread=0; 18 | noOfCasts=1; 19 | homing=true; 20 | hasTrail=true; 21 | } 22 | 23 | 24 | 25 | 26 | } 27 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellProperties/SpellProp_Luck.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class SpellProp_Luck : SpellProp { 6 | 7 | public override void init (int effectId, GameObject SpellCaster) 8 | { 9 | counter=5; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellProperties/SpellProp_MagicArrow.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class SpellProp_MagicArrow : SpellProp { 5 | //Properties for the Ort Jux spell. 6 | 7 | public override void init(int effectId, GameObject SpellCaster) 8 | { 9 | base.init (effectId,SpellCaster); 10 | //ProjectileSprite = UWEBase._RES +"/Sprites/Objects/Objects_023"; 11 | ProjectileItemId=23; 12 | Force=200.0f; 13 | BaseDamage=3; 14 | impactFrameStart=46; 15 | impactFrameEnd=50; 16 | spread=0; 17 | noOfCasts=1; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellProperties/SpellProp_Poison.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class SpellProp_Poison : SpellProp { 5 | 6 | public override void init (int effectId, GameObject SpellCaster) 7 | { 8 | base.init (effectId,SpellCaster); 9 | damagetype = DamageTypes.poison; 10 | impactFrameStart=40; 11 | impactFrameEnd=44; 12 | switch (effectId) 13 | {//TODO:what values? How does this affect the player or NPC casts of poison? 14 | //This basedamage values will affect the npc. 15 | case SpellEffect.UW1_Spell_Effect_Poison: 16 | BaseDamage=50;counter=5;break; 17 | case SpellEffect.UW1_Spell_Effect_Poison_alt01: 18 | BaseDamage=100;counter=6;break; 19 | case SpellEffect.UW1_Spell_Effect_PoisonHidden: 20 | BaseDamage=40;counter=5;break; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellProperties/SpellProp_Regen.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class SpellProp_Regen : SpellProp { 6 | 7 | public override void init (int effectId, GameObject SpellCaster) 8 | { 9 | damagetype = DamageTypes.aid; 10 | switch (_RES) 11 | { 12 | case GAME_UW2: 13 | { 14 | switch(effectId) 15 | { 16 | default: 17 | // case SpellEffect.UW2_Spell_Effect_ManaRegeneration: 18 | { 19 | BaseDamage = 20; 20 | counter = 3; 21 | break; 22 | } 23 | } 24 | break; 25 | } 26 | default: 27 | { 28 | switch(effectId) 29 | { 30 | default: 31 | //case SpellEffect.UW1_Spell_Effect_ManaRegeneration: 32 | { 33 | BaseDamage = 20; 34 | counter = 3; 35 | break; 36 | } 37 | } 38 | break; 39 | } 40 | 41 | } 42 | } 43 | 44 | 45 | } 46 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellProperties/SpellProp_Resistance.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class SpellProp_Resistance : SpellProp { 5 | 6 | public override void init (int effectId, GameObject SpellCaster) 7 | { 8 | base.init (effectId,SpellCaster); 9 | damagetype = DamageTypes.protection; 10 | switch (effectId) 11 | { 12 | case SpellEffect.UW1_Spell_Effect_ResistBlows: 13 | case SpellEffect.UW1_Spell_Effect_ResistBlows_alt01: 14 | case SpellEffect.UW1_Spell_Effect_ResistBlows_alt02: 15 | BaseDamage=1;counter=3;break; 16 | case SpellEffect.UW1_Spell_Effect_ThickSkin: 17 | case SpellEffect.UW1_Spell_Effect_ThickSkin_alt01: 18 | case SpellEffect.UW1_Spell_Effect_ThickSkin_alt02: 19 | BaseDamage=2;counter=4;break; 20 | case SpellEffect.UW1_Spell_Effect_IronFlesh: 21 | case SpellEffect.UW1_Spell_Effect_IronFlesh_alt01: 22 | case SpellEffect.UW1_Spell_Effect_IronFlesh_alt02: 23 | BaseDamage=3;counter=5;break; 24 | default: 25 | Debug.Log("Default values used in resistance spell"); 26 | BaseDamage=1;counter=3;break; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellProperties/SpellProp_SheetLightning.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class SpellProp_SheetLightning : SpellProp_Fireball { 5 | //Sheet Lightning 6 | 7 | public override void init(int effectId, GameObject SpellCaster) 8 | { 9 | base.init (effectId,SpellCaster); 10 | damagetype = DamageTypes.electric; 11 | //ProjectileSprite = UWEBase._RES +"/Sprites/object_blank"; 12 | ProjectileItemId=21;//This shoudld be something invisible. 13 | Force=500.0f; 14 | BaseDamage=8; 15 | splashDamage=3; 16 | splashDistance=1.0f; 17 | impactFrameStart=50; 18 | impactFrameEnd=53; 19 | spread=4; 20 | noOfCasts=Random.Range(1,3); 21 | SecondaryStartFrame=50; 22 | SecondaryEndFrame=53; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellProperties/SpellProp_Stealth.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class SpellProp_Stealth : SpellProp { 5 | public int StealthLevel;//What skill bonus this spell gives. 6 | public override void init (int effectId, GameObject SpellCaster) 7 | { 8 | base.init (effectId,SpellCaster); 9 | damagetype = DamageTypes.aid; 10 | switch(effectId) 11 | { 12 | case SpellEffect.UW1_Spell_Effect_Stealth: 13 | case SpellEffect.UW1_Spell_Effect_Stealth_alt01: 14 | case SpellEffect.UW1_Spell_Effect_Stealth_alt02: 15 | StealthLevel=5;counter=2;break; 16 | 17 | case SpellEffect.UW1_Spell_Effect_Conceal: 18 | case SpellEffect.UW1_Spell_Effect_Conceal_alt01: 19 | case SpellEffect.UW1_Spell_Effect_Conceal_alt02: 20 | StealthLevel=15;counter=3;break; 21 | 22 | case SpellEffect.UW1_Spell_Effect_Invisibilty: 23 | case SpellEffect.UW1_Spell_Effect_Invisibility_alt01: 24 | case SpellEffect.UW1_Spell_Effect_Invisibility_alt02: 25 | StealthLevel=30;counter=5;break; 26 | 27 | default: 28 | Debug.Log("Default values used in stealth spell"); 29 | StealthLevel=30;counter=5;break; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellProperties/SpellProp_SummonMonster.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class SpellProp_SummonMonster : SpellProp { 5 | /* 6 | * NPC properties for SummonMonster. 7 | * TODO: Include more advanced monster properties. 8 | */ 9 | int[] NPCs={ 10 | 64, 11 | 65, 12 | 66, 13 | 67, 14 | 68, 15 | 69, 16 | 70, 17 | 71, 18 | 72, 19 | 73, 20 | 74, 21 | 75, 22 | 76, 23 | 77, 24 | 78, 25 | 79, 26 | 80, 27 | 81, 28 | 82, 29 | 83, 30 | 84, 31 | 85, 32 | 86, 33 | 87, 34 | 88, 35 | 89, 36 | 90, 37 | 91, 38 | 92, 39 | 93, 40 | 94, 41 | 95, 42 | 96, 43 | 97, 44 | 98, 45 | 99, 46 | 100, 47 | 101, 48 | 102, 49 | 103, 50 | 104, 51 | 105, 52 | 106, 53 | 107, 54 | 108, 55 | 109, 56 | 110, 57 | 111, 58 | 112, 59 | 113, 60 | 114, 61 | 115, 62 | 116, 63 | 117, 64 | 118, 65 | 119, 66 | 120, 67 | 121 68 | }; 69 | 70 | public int RndNPC; 71 | 72 | public override void init(int effectId, GameObject SpellCaster) 73 | { 74 | base.init (effectId,SpellCaster); 75 | damagetype = DamageTypes.aid; 76 | //Pick a random npc from the list of npcs 77 | RndNPC=NPCs[Random.Range(0,NPCs.GetUpperBound(0))]; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Magic/SpellProperties/SpellProp_Tym.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class SpellProp_Tym : SpellProp { 6 | 7 | public override void onHitPlayer () 8 | { 9 | //Freeze player for 15 seconds. 10 | UWCharacter.Instance.ParalyzeTimer = 15; 11 | //000~001~355~You feel your limbs stiffen. You are unable to move. \n 12 | UWHUD.instance.MessageScroll.Add(StringController.instance.GetString(1, 355)); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Motors/taken from.txt: -------------------------------------------------------------------------------- 1 | https://gist.github.com/zephjc/5641540 -------------------------------------------------------------------------------- /UnityScripts/scripts/NPC/NPC_Door.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | /// 4 | /// Special case to support conversation with the talking door 5 | /// 6 | public class NPC_Door : NPC { 7 | 8 | /// 9 | /// NPC Does not need a start like NPcs 10 | /// 11 | protected override void Start () 12 | { 13 | //this.gameObject.tag="NPCs"; 14 | } 15 | 16 | /// 17 | /// NPC Door update is not required. 18 | /// 19 | public override void Update() 20 | { 21 | //base.Update (); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /UnityScripts/scripts/NPC/NPC_Wisp.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | /// 5 | /// NPC wisp in the ethereal void. Is not really an NPC but an animated decoration 6 | /// 7 | public class NPC_Wisp : NPC { 8 | 9 | /// 10 | /// NPC Does not need a start like NPcs 11 | /// 12 | protected override void Start () 13 | { 14 | npc_whoami=48;//Wisp conversation. 15 | } 16 | 17 | /// 18 | /// NPC Door update is not required. 19 | /// 20 | public override void Update() 21 | { 22 | //base.Update (); 23 | } 24 | 25 | public override bool ApplyAttack (short damage, GameObject source) 26 | { 27 | return true; 28 | } 29 | 30 | public override bool ApplyAttack (short damage) 31 | { 32 | return true; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Objects/Anvil.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class Anvil : object_base { 5 | 6 | /// 7 | /// The anvil becomes a special object in hand 8 | /// 9 | /// Actual anvil repairs handled by Equipment 10 | public override bool use () 11 | { 12 | if (CurrentObjectInHand==null) 13 | { 14 | BecomeObjectInHand(); 15 | UWCharacter.InteractionMode = UWCharacter.InteractionModeUse; 16 | UWHUD.instance.MessageScroll.Set("Use Anvil on what?"); 17 | return true; 18 | } 19 | else 20 | { 21 | return ActivateByObject(CurrentObjectInHand); 22 | } 23 | } 24 | 25 | 26 | public override string UseVerb() 27 | { 28 | return "repair"; 29 | } 30 | 31 | public override bool FailMessage() 32 | { 33 | UWHUD.instance.MessageScroll.Add(StringController.instance.GetString(1, StringController.str_you_cannot_repair_that_)); 34 | return true; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Objects/Bedroll.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class Bedroll : object_base { 5 | 6 | public override bool use () 7 | { 8 | if (CurrentObjectInHand==null) 9 | { 10 | UWCharacter.Instance.Sleep(); 11 | return true; 12 | } 13 | else 14 | { 15 | return ActivateByObject(CurrentObjectInHand); 16 | } 17 | } 18 | 19 | public override string UseVerb () 20 | { 21 | return "sleep"; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Objects/BlackrockGem.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class BlackrockGem : object_base { 5 | //One of the small blackrock gemstones 6 | // 7 | public override bool LookAt () 8 | { 9 | string lookdesc; 10 | if (owner==1) 11 | { 12 | lookdesc=StringController.instance.GetString(1,StringController.str_you_see_) 13 | + " a " 14 | + StringController.instance.GetString(1,357) 15 | + StringController.instance.GetSimpleObjectNameUW(objInt()) ; 16 | } 17 | else 18 | { 19 | lookdesc=StringController.instance.GetString(1,StringController.str_you_see_) 20 | + " a " 21 | + StringController.instance.GetString(1,356) 22 | + StringController.instance.GetSimpleObjectNameUW(objInt()) ; 23 | } 24 | UWHUD.instance.MessageScroll.Add(lookdesc); 25 | return true; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Objects/Boots.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | /// 4 | /// Boots. 5 | /// 6 | /// Wearable boots 7 | public class Boots : Armour { 8 | 9 | protected override void Start () 10 | { 11 | base.Start(); 12 | if ((item_id == 47) && (_RES==GAME_UW1)) 13 | {//Retroactive fix to improperly created dragonskin boots. 14 | link=0; 15 | } 16 | } 17 | 18 | public override int GetActualSpellIndex () 19 | { 20 | if ((item_id == 47) && (_RES==GAME_UW1)) 21 | { 22 | return SpellEffect.UW1_Spell_Effect_Flameproof_alt01; 23 | } 24 | else 25 | { 26 | return base.GetActualSpellIndex(); 27 | } 28 | 29 | } 30 | 31 | 32 | } -------------------------------------------------------------------------------- /UnityScripts/scripts/Objects/Boulder.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hankmorgan/UnderworldExporter/64f5c2310e95c2e507725b9c69955e645b80de0b/UnityScripts/scripts/Objects/Boulder.cs -------------------------------------------------------------------------------- /UnityScripts/scripts/Objects/DoorKey.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | /// 4 | /// Door key. 5 | /// 6 | /// Guess 7 | public class DoorKey : object_base { 8 | ///This should match the doors it is opening. Also index into look descriptions 9 | public int KeyId; 10 | 11 | protected override void Start() 12 | { 13 | KeyId = owner; 14 | } 15 | 16 | public override bool use () 17 | { 18 | if (objInt().PickedUp==true) 19 | { 20 | if (CurrentObjectInHand==null) 21 | { 22 | BecomeObjectInHand(); 23 | UWHUD.instance.MessageScroll.Set (StringController.instance.GetString(1,7)); 24 | return true; 25 | } 26 | else 27 | { 28 | return ActivateByObject(CurrentObjectInHand); 29 | } 30 | } 31 | else 32 | { 33 | objInt().FailMessage(); 34 | return false; 35 | } 36 | } 37 | 38 | public override bool LookAt () 39 | { 40 | if (objInt().PickedUp==true) 41 | { 42 | UWHUD.instance.MessageScroll.Add(StringController.instance.GetString(5,owner+100)); 43 | } 44 | else 45 | { 46 | UWHUD.instance.MessageScroll.Add(StringController.instance.GetFormattedObjectNameUW(objInt())); 47 | } 48 | 49 | return true; 50 | } 51 | } -------------------------------------------------------------------------------- /UnityScripts/scripts/Objects/DreamPlant.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class DreamPlant : object_base { 5 | 6 | 7 | public override bool use () 8 | { 9 | if ((CurrentObjectInHand==null) || (CurrentObjectInHand==this)) 10 | { 11 | return Eat(); 12 | } 13 | else 14 | { 15 | return ActivateByObject(CurrentObjectInHand); 16 | } 17 | } 18 | 19 | 20 | public override bool Eat () 21 | { 22 | if (23+UWCharacter.Instance.FoodLevel>=255) 23 | { 24 | UWHUD.instance.MessageScroll.Add (StringController.instance.GetString(1,StringController.str_you_are_too_full_to_eat_that_now_)); 25 | return false; 26 | } 27 | else 28 | { 29 | UWCharacter.Instance.FoodLevel = 23+UWCharacter.Instance.FoodLevel; 30 | Quest.instance.DreamPlantEaten=true; 31 | //000~001~248~The plant is plain tasting but nourishing. \n 32 | UWHUD.instance.MessageScroll.Add(StringController.instance.GetString(1,248)); 33 | objInt().consumeObject(); 34 | return true; 35 | } 36 | 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Objects/Fountain.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class Fountain : object_base { 5 | //Code for handing fountain behaviour. 6 | 7 | public override bool use () 8 | { 9 | if (CurrentObjectInHand==null) 10 | { 11 | if ((objInt().isEnchanted) &&(link>=512)) 12 | { 13 | UWCharacter.Instance.PlayerMagic.CastEnchantment(UWCharacter.Instance.gameObject,null,link-512,Magic.SpellRule_TargetSelf,Magic.SpellRule_Consumable); 14 | } 15 | UWHUD.instance.MessageScroll.Add (StringController.instance.GetString (1,StringController.str_the_water_refreshes_you_)); 16 | return true; 17 | } 18 | else 19 | { 20 | return ActivateByObject(CurrentObjectInHand); 21 | } 22 | } 23 | 24 | 25 | public override string UseVerb () 26 | { 27 | return "drink"; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Objects/Gloves.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class Gloves : Armour { 5 | 6 | } -------------------------------------------------------------------------------- /UnityScripts/scripts/Objects/Helm.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class Helm : Armour { 5 | 6 | public override int GetActualSpellIndex() 7 | { 8 | if (link - 512 >= 256) //?Is this right?? 9 | { 10 | return link - 240; 11 | } 12 | else 13 | { 14 | return link - 512; 15 | } 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Objects/Leech.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | /// 4 | /// Leches can be used to cure poison 5 | /// 6 | public class Leech : object_base { 7 | 8 | 9 | public override bool use () 10 | { 11 | if (CurrentObjectInHand==null) 12 | { 13 | UWCharacter.Instance.PlayerMagic.CastEnchantment(UWCharacter.Instance.gameObject,null, SpellEffect.UW1_Spell_Effect_CurePoison,Magic.SpellRule_TargetSelf,Magic.SpellRule_Consumable); 14 | UWHUD.instance.MessageScroll.Add(StringController.instance.GetString (1,StringController.str_the_leeches_remove_the_poison_as_well_as_some_of_your_skin_and_blood_)); 15 | UWCharacter.Instance.ApplyDamage(Random.Range (1,6)); 16 | objInt().consumeObject(); 17 | return true; 18 | } 19 | else 20 | { 21 | return ActivateByObject (CurrentObjectInHand); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Objects/Leggings.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class Leggings : Armour { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Objects/LockPick.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | /// 4 | /// Lock pick. 5 | /// 6 | /// Used to pick door locks 7 | public class LockPick : object_base { 8 | public override bool use() 9 | { 10 | if (objInt().PickedUp==true) 11 | { 12 | if(CurrentObjectInHand==null) 13 | { 14 | BecomeObjectInHand(); 15 | UWHUD.instance.MessageScroll.Set ( StringController.instance.GetString(1,8)); 16 | return true; 17 | } 18 | else 19 | { 20 | return ActivateByObject(CurrentObjectInHand); 21 | } 22 | } 23 | else 24 | { 25 | objInt().FailMessage (); 26 | return false; 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /UnityScripts/scripts/Objects/MagicScroll.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class MagicScroll : enchantment_base { 5 | public override bool use () 6 | { 7 | if (ConversationVM.InConversation) { return false; } 8 | if (CurrentObjectInHand==null) 9 | { 10 | UWCharacter.Instance.PlayerMagic.CastEnchantment(UWCharacter.Instance.gameObject,null,GetActualSpellIndex(),Magic.SpellRule_TargetSelf,Magic.SpellRule_Consumable ); 11 | objInt().consumeObject(); 12 | return true; 13 | } 14 | else 15 | { 16 | return ActivateByObject(CurrentObjectInHand); 17 | } 18 | } 19 | 20 | 21 | public override string UseVerb () 22 | { 23 | return "cast"; 24 | } 25 | 26 | public override bool ApplyAttack (short damage) 27 | { 28 | quality-=damage; 29 | if (quality<=0) 30 | { 31 | ChangeType(213);//Change to debris. 32 | this.gameObject.AddComponent();//Add a generic object base for behaviour. THis is the famous magic debris 33 | //Remove the potion enchantment. 34 | ObjectInteraction.DestroyObjectFromUW(this.objInt()); 35 | } 36 | return true; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Objects/MoonStone.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | /// 4 | /// Used by the Gate Travel spell as a teleport target 5 | /// 6 | public class MoonStone : object_base { 7 | 8 | protected override void Start () 9 | { 10 | base.Start (); 11 | UWCharacter.Instance.MoonGateLevel = (short)(GameWorldController.instance.LevelNo+1); 12 | UWCharacter.Instance.MoonGatePosition=this.transform.position; 13 | } 14 | 15 | /// 16 | /// Updates the location of the moonstone 17 | /// 18 | /// TODO: only update when position changes? 19 | /// Or find when on spell cast or Update when leaving level. 20 | public override void Update() 21 | { 22 | base.Update(); 23 | if (objInt().PickedUp==false) 24 | { 25 | UWCharacter.Instance.MoonGateLevel = (short)(GameWorldController.instance.LevelNo+1); 26 | UWCharacter.Instance.MoonGatePosition=this.transform.position; 27 | } 28 | else 29 | { 30 | UWCharacter.Instance.MoonGatePosition=Vector3.zero; 31 | } 32 | } 33 | 34 | 35 | } 36 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Objects/ObjectVariables.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class ObjectVariables : MonoBehaviour { 5 | 6 | //USED IN SHOCK ONLY 7 | public int triggerX; 8 | public int triggerY; 9 | public int Hidden;//Is the object visible 10 | public int state; 11 | 12 | public string trigger; 13 | //private GameObject level; 14 | 15 | //public string SpriteNameOpened; 16 | //public string triggeringObject; 17 | 18 | // Use this for initialization 19 | void Start () { 20 | //level=GameObject.Find("level"); 21 | } 22 | 23 | public GameObject findDoor(int x, int y) 24 | {//Finds a door in the tile pointed to by two coordinates. 25 | // Debug.Log ("trying to find door called door_" +x .ToString ("D3") + "_" + y.ToString ("D3")); 26 | return GameObject.Find ("door_" +x .ToString ("D3") + "_" + y.ToString ("D3")); 27 | } 28 | 29 | 30 | //public static string LookupString(int BlockNo, int StringNo) 31 | //{//Finds the string 32 | // return BlockNo + "_" + StringNo; 33 | //} 34 | } 35 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Objects/Oil.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class Oil : object_base { 5 | 6 | public override bool use () 7 | { 8 | if (objInt().PickedUp==true) 9 | { 10 | if (CurrentObjectInHand==null) 11 | { 12 | BecomeObjectInHand(); 13 | UWHUD.instance.MessageScroll.Set ("Use oil on?"); 14 | return true; 15 | } 16 | else 17 | { 18 | return ActivateByObject(CurrentObjectInHand); 19 | } 20 | } 21 | else 22 | 23 | { 24 | objInt().FailMessage(); 25 | return false; 26 | } 27 | } 28 | 29 | 30 | public override bool FailMessage () 31 | { 32 | UWHUD.instance.MessageScroll.Add (StringController.instance.GetString(1,StringController.str_you_cannot_use_oil_on_that_)); 33 | return false; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Objects/OrbRock.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class OrbRock : object_base { 5 | 6 | public static void DestroyOrb(ObjectInteraction orbToDestroy) 7 | { 8 | //Spawn an impact 9 | Impact.SpawnHitImpact(Impact.ImpactDamage(), orbToDestroy.GetImpactPoint(),46,50); 10 | Quest.instance.isOrbDestroyed=true; 11 | UWCharacter.Instance.PlayerMagic.MaxMana=UWCharacter.Instance.PlayerMagic.TrueMaxMana; 12 | UWCharacter.Instance.PlayerMagic.CurMana=UWCharacter.Instance.PlayerMagic.MaxMana; 13 | //000-001-133 The orb is destroyed 14 | UWHUD.instance.MessageScroll.Add(StringController.instance.GetString (1,133)); 15 | 16 | orbToDestroy.consumeObject(); 17 | } 18 | 19 | void OnCollisionEnter(Collision collision) 20 | {// 21 | if (objInt().PickedUp==false) 22 | { 23 | if ((GameWorldController.instance.LevelNo==6) && (_RES==GAME_UW1)) 24 | { 25 | if(collision.gameObject.name.Contains("orb")) 26 | { 27 | ObjectInteraction HitobjInt = collision.gameObject.GetComponent(); 28 | if (HitobjInt.GetItemType()==ObjectInteraction.ORB) 29 | { 30 | DestroyOrb(HitobjInt); 31 | } 32 | } 33 | } 34 | } 35 | 36 | } 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Objects/Pillar.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class Pillar : map_object { 5 | 6 | 7 | protected override void Start () 8 | { 9 | base.Start (); 10 | BoxCollider bx = this.GetComponent(); 11 | if (bx!=null) 12 | { 13 | bx.center=new Vector3(0.0f, 0.0f, 0.0f); 14 | bx.size=new Vector3(0.1f, 12f, 0.1f); 15 | } 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Objects/PocketWatch.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class PocketWatch : object_base { 5 | 6 | 7 | 8 | public override bool use () 9 | {//000~001~039~The watch reads 10 | UWHUD.instance.MessageScroll.Add(StringController.instance.GetString(1,39) + GameClock.hour() + ":" + GameClock.minute().ToString("d2")); 11 | return true; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Objects/Pole.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class Pole : object_base { 5 | //000~001~157~Using the pole you trigger the switch. 6 | //000~001~158~The pole cannot be used on that. 7 | 8 | public override bool use () 9 | { 10 | if (objInt().PickedUp==true) 11 | { 12 | if (CurrentObjectInHand==null) 13 | { 14 | BecomeObjectInHand(); 15 | return true; 16 | } 17 | else 18 | { 19 | return ActivateByObject(CurrentObjectInHand); 20 | } 21 | } 22 | else 23 | { 24 | objInt().FailMessage (); 25 | return false; 26 | } 27 | } 28 | 29 | public override bool FailMessage () 30 | { 31 | UWHUD.instance.MessageScroll.Add (StringController.instance.GetString(1,StringController.str_the_pole_cannot_be_used_on_that_)); 32 | return false; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Objects/PortcullisInteraction.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class PortcullisInteraction : MonoBehaviour { 5 | 6 | /// 7 | /// Gets the parent object interaction. Matches the trigger with the actual door control 8 | /// 9 | /// The parent object interaction. 10 | public ObjectInteraction getParentObjectInteraction() 11 | { 12 | return this.transform.parent.parent.GetComponent(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Objects/Props.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | /// 5 | /// Base class for properties files 6 | /// 7 | public class Props : UWClass { 8 | 9 | //public string _RES="UW1"; 10 | } 11 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Objects/ReadableTrap.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class ReadableTrap : object_base { 5 | 6 | //Explodes in your face book. public override bool use () 7 | public override bool use () 8 | { 9 | if (CurrentObjectInHand == null) 10 | { 11 | UWHUD.instance.MessageScroll.Add ("The book explodes in your face!"); 12 | UWCharacter.Instance.ApplyDamage(Random.Range (1,20)); 13 | Quest.instance.QuestVariables[8]=1;//For Bronus/Morlock quest. 14 | objInt().consumeObject (); 15 | return true; 16 | } 17 | else 18 | { 19 | return ActivateByObject(CurrentObjectInHand); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Objects/RuneStone.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class RuneStone : object_base { 5 | 6 | 7 | } 8 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Objects/Spike.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class Spike : object_base { 5 | 6 | public override bool use () 7 | { 8 | if (objInt().PickedUp==true) 9 | { 10 | if (CurrentObjectInHand==null) 11 | { 12 | BecomeObjectInHand(); 13 | UWHUD.instance.MessageScroll.Set (StringController.instance.GetString(1,130)); 14 | return true; 15 | } 16 | else 17 | { 18 | return ActivateByObject(CurrentObjectInHand); 19 | } 20 | } 21 | else 22 | { 23 | objInt().FailMessage (); 24 | return false; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Objects/WeaponRanged.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class WeaponRanged : Weapon { 5 | 6 | //public int AmmoType;//Item_id of the ammo to be used. (Why not make it anything I want it to be! 7 | //public int durabil; 8 | 9 | 10 | public int AmmoType() 11 | { 12 | return GameWorldController.instance.objDat.rangedStats[item_id-24].ammo; 13 | } 14 | 15 | 16 | public int Damage() 17 | { 18 | return GameWorldController.instance.objDat.rangedStats[item_id-24].damage; 19 | } 20 | } 21 | 22 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Objects/Zanium.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | /// 4 | /// Zanium. The fantabulous material that is self attractive. 5 | /// 6 | public class Zanium : object_base { 7 | 8 | /// 9 | /// Sucks up zanium. 10 | /// 11 | ///Find the first instance of zanium in the inventory and increases it's quantity before destroying the zanium in the gameworld 12 | public void SuckUpZanium() 13 | { 14 | // 15 | ObjectInteraction someZanium=UWCharacter.Instance.playerInventory.findObjInteractionByID(item_id); 16 | if (someZanium!=null) 17 | {//Add the zanium to the pile 18 | someZanium.link += link; 19 | someZanium.isquant=1; 20 | objInt().consumeObject(); 21 | UWCharacter.Instance.playerInventory.Refresh();//Update the display 22 | } 23 | } 24 | 25 | 26 | 27 | void OnTriggerEnter(Collider other) 28 | { 29 | if ((other.name==UWCharacter.Instance.name)) 30 | { 31 | SuckUpZanium(); 32 | } 33 | } 34 | 35 | } 36 | 37 | 38 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Objects/a_candle.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | /// 6 | /// lightsource variant for UW2 which can be eaten! 7 | /// 8 | public class a_candle : LightSource 9 | { 10 | 11 | 12 | public override bool Eat() 13 | { 14 | if (IsOn()) 15 | { 16 | //do nothinbg 17 | return true; 18 | } 19 | else 20 | { 21 | //000~001~245~You eat the candle, but doubt that it was good for you. \n 22 | UWHUD.instance.MessageScroll.Add(StringController.instance.GetString(1, 245)); 23 | objInt().consumeObject(); 24 | return true; 25 | } 26 | } 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Objects/a_spell.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | /// 5 | /// A spell. Used to carry the spell index for wands. 6 | /// 7 | public class a_spell : object_base { 8 | 9 | 10 | } 11 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Objects/a_splash.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class a_splash : object_base { 6 | 7 | //public AudioSource aud; 8 | // Use this for initialization 9 | 10 | public override void InitSound() 11 | { 12 | base.InitSound(); 13 | 14 | //aud = this.GetComponent(); 15 | objInt().aud.clip = MusicController.instance.SoundEffects[MusicController.SOUND_EFFECT_SPLASH_1]; 16 | objInt().aud.playOnAwake = false; 17 | objInt().aud.loop = true; 18 | objInt().aud.volume = 0.1f; 19 | objInt().aud.maxDistance = 10f; 20 | objInt().aud.rolloffMode = AudioRolloffMode.Linear; 21 | objInt().aud.Play(); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Objects/container_obj.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | /// 6 | /// Placeholding object_base to allow interacting with containers in the world 7 | /// 8 | public class container_obj : object_base { 9 | 10 | public override bool use() 11 | { 12 | return this.GetComponent().use(); 13 | } 14 | 15 | 16 | public override float GetWeight() 17 | { 18 | return this.GetComponent().GetWeight(base.GetWeight()); 19 | } 20 | 21 | 22 | public override string UseVerb() 23 | { 24 | return "open"; 25 | } 26 | 27 | public override string UseObjectOnVerb_Inv() 28 | { 29 | return "place object in container"; 30 | } 31 | 32 | 33 | public override bool DropEvent() 34 | { 35 | base.DropEvent(); 36 | return this.GetComponent().DropEvent(); 37 | } 38 | 39 | 40 | public override bool PickupEvent() 41 | { 42 | base.PickupEvent(); 43 | return this.GetComponent().PickupEvent(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Objects/forcefield.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.AI; 5 | 6 | public class forcefield : object_base { 7 | BoxCollider bx; 8 | 9 | protected override void Start () 10 | { 11 | base.Start (); 12 | bx = this.gameObject.GetComponent(); 13 | if (bx==null) 14 | { 15 | bx = this.gameObject.AddComponent(); 16 | } 17 | bx.size=new Vector3(1.2f,5f,1.2f); 18 | //TODO: Make this fit the level properly 19 | bx.center= new Vector3(0f,2.5f,0f); 20 | this.gameObject.layer= LayerMask.NameToLayer("MapMesh"); 21 | } 22 | 23 | 24 | public override void Update() 25 | { 26 | bx.enabled=true; 27 | if (_RES==GAME_UW2) 28 | { 29 | ObjectInteraction objInGloveSlot = UWCharacter.Instance.playerInventory.GetObjectIntAtSlot(4); 30 | if (objInGloveSlot != null) 31 | { 32 | if (objInGloveSlot.item_id == 51) 33 | {//Fraznium gloves 34 | bx.enabled = false; 35 | } 36 | } 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Objects/map_object.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | /// 5 | /// Map object that exists as both a game object and a 3d map object 6 | /// 7 | public class map_object : object_base { 8 | public GameObject ModelInstance;//The model that this bridge uses. 9 | 10 | 11 | protected override void Start () 12 | { 13 | base.Start(); 14 | if (invis==0) 15 | { 16 | foreach (Transform t in GameWorldController.instance.SceneryModel.transform) 17 | { 18 | if (t.name == this.name) 19 | { 20 | ModelInstance = t.gameObject; 21 | return; 22 | } 23 | } 24 | } 25 | else 26 | {//Make this object use it's box collider for collision 27 | this.gameObject.layer=LayerMask.NameToLayer("MapMesh"); 28 | } 29 | } 30 | 31 | public override void DestroyEvent() 32 | { 33 | base.DestroyEvent(); 34 | Destroy(ModelInstance); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Player Character/IceCollision.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class IceCollision : UWEBase { 5 | 6 | void OnTriggerEnter(Collider other) 7 | { 8 | 9 | if (UWCharacter.Instance.onIce) 10 | { 11 | //Vector3.Reflect(UWCharacter.Instance.IceVelocity, other. 12 | Debug.Log ("bounce off of " + other.name); 13 | } 14 | 15 | } 16 | 17 | 18 | void OnCollisionEnter(Collision collision) 19 | { 20 | if (UWCharacter.Instance.onIce) 21 | { 22 | //Vector3.Reflect(UWCharacter.Instance.IceVelocity, other. 23 | Debug.Log ("collision off o f " + collision.gameObject.name); 24 | } 25 | 26 | } 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Traps/a_change_to_trap.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class a_change_to_trap : trap_base { 5 | 6 | //Theory. Untested 7 | //This is used to change the texture on a range of tiles. 8 | //The From trap defines the start 9 | //and the to trap defines the end of the block. 10 | 11 | //Changing the owner changes the tile type (10 is open) 12 | //changing the zpos (bits 0-3) changes the tile heights 13 | //val=31 seems to leave tile the same as it was 14 | //heading and bit 4 of the zpos changes the texture of the floor 15 | //quality changes the wall textures (63 is no change made) 16 | 17 | //See the from trap for implemenation of this trap pair. 18 | 19 | 20 | public override void ExecuteTrap (object_base src, int triggerX, int triggerY, int State) 21 | { 22 | Debug.Log(this.name + "triggerX = " + triggerX + " triggerY = " + triggerY); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Traps/a_combination_trap.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class a_combination_trap : trap_base{ 5 | 6 | 7 | } 8 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Traps/a_do_trap_EndGame.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | /// 5 | /// Ends the game. Plays the ending cutscene. 6 | /// 7 | public class a_do_trap_EndGame : a_hack_trap { 8 | 9 | public override void ExecuteTrap (object_base src, int triggerX, int triggerY, int State) 10 | { 11 | Debug.Log (this.name); 12 | Cutscene_EndGame ce = UWHUD.instance.gameObject.AddComponent(); 13 | UWHUD.instance.CutScenesFull.cs=ce; 14 | UWHUD.instance.CutScenesFull.Begin(); 15 | 16 | } 17 | 18 | public override void PostActivate (object_base src) 19 | { 20 | //Stop camera from destroying itself 21 | Debug.Log("Overridden PostActivate to test " + this.name); 22 | base.PostActivate(src); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Traps/a_do_trap_conversation.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | /// 4 | /// A Talking Door! 5 | /// 6 | public class a_do_trap_conversation : a_hack_trap { 7 | 8 | protected override void Start () 9 | { 10 | base.Start (); 11 | //Set up this talking door! 12 | NPC_Door np =this.gameObject.AddComponent(); 13 | np.npc_whoami=25; 14 | } 15 | 16 | public override bool Activate (object_base src,int triggerX, int triggerY, int State) 17 | { 18 | if (ConversationVM.InConversation==false) 19 | { 20 | NPC_Door np = this.GetComponent(); 21 | if (np!=null) 22 | { 23 | UWCharacter.InteractionMode=UWCharacter.InteractionModeTalk; 24 | InteractionModeControl.UpdateNow=true; 25 | return np.TalkTo(); 26 | } 27 | } 28 | return false; 29 | } 30 | 31 | public override void PostActivate (object_base src) 32 | {//Do not destroy 33 | Debug.Log("Overridden PostActivate to test " + this.name); 34 | base.PostActivate(src); 35 | } 36 | } -------------------------------------------------------------------------------- /UnityScripts/scripts/Traps/a_do_trap_jailor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class a_do_trap_jailor : a_hack_trap { 6 | 7 | //Triggers conversation with feral troll jail in tybals lair (if they are alive) 8 | 9 | //TODO:Check if this should match to a npc_whoami instead of a specific object Id 10 | public override void ExecuteTrap (object_base src, int triggerX, int triggerY, int State) 11 | { 12 | ObjectInteraction npc = ObjectLoader.getObjectIntAt(251); 13 | if (npc!=null) 14 | { 15 | if (npc.GetComponent()!=null) 16 | { 17 | if (npc.GetComponent().npc_whoami == 216) 18 | { 19 | npc.TalkTo(); 20 | } 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Traps/a_hack_trap_change_goal.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | /// 6 | /// Changes the goal of a type of npc 7 | /// 8 | /// zpos seems to be the controlling param here for what npcs are affected. Matches against WhoAmI 9 | /// Owner is the attitude to change to 10 | public class a_hack_trap_change_goal : a_hack_trap { 11 | 12 | public override void ExecuteTrap(object_base src, int triggerX, int triggerY, int State) 13 | { 14 | NPC[] foundNPCs = GameWorldController.instance.DynamicObjectMarker().GetComponentsInChildren(); 15 | for (int i = 0; i < foundNPCs.GetUpperBound(0); i++) 16 | { 17 | if (foundNPCs[i].npc_whoami == zpos) 18 | { 19 | foundNPCs[i].npc_goal= (short)owner; 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Traps/a_hack_trap_scintpuzzlereset.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | /// 6 | /// Resets the variable for the switches on scintillus level 5. (will clear the bit variables in zpos) 7 | /// 8 | public class a_hack_trap_scintpuzzlereset : a_hack_trap { 9 | 10 | public override void ExecuteTrap (object_base src, int triggerX, int triggerY, int State) 11 | { 12 | //Quest.instance.ScintLvl5Switches=0; 13 | Quest.instance.BitVariables[zpos] = 0; 14 | } 15 | 16 | public override void PostActivate (object_base src) 17 | { 18 | //do not destroy 19 | Debug.Log("Overridden PostActivate to test " + this.name); 20 | base.PostActivate(src); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Traps/a_hack_trap_sleep.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class a_hack_trap_sleep : a_hack_trap{ 5 | 6 | public override void ExecuteTrap (object_base src, int triggerX, int triggerY, int State) 7 | { 8 | UWCharacter.Instance.Sleep(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Traps/a_hack_trap_texture.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | /// 5 | /// A hack trap texture. 6 | /// 7 | /// changes the texture of the object it is linked to 8 | /// Only instance seen so far is to change the texture map object. 9 | public class a_hack_trap_texture : a_hack_trap { 10 | 11 | 12 | public override void ExecuteTrap (object_base src, int triggerX, int triggerY, int State) 13 | { 14 | if (link!=0) 15 | { 16 | GameObject obj = ObjectLoader.getGameObjectAt(link); 17 | if (obj!=null) 18 | { 19 | TMAP tmap = obj.GetComponent(); 20 | if (tmap!=null) 21 | { 22 | tmap.owner=owner; 23 | tmap.TextureIndex=CurrentTileMap().texture_map[owner]; 24 | TMAP.CreateTMAP(obj, tmap.TextureIndex ); 25 | } 26 | else 27 | { 28 | Debug.Log("no tmap found on " + obj.name); 29 | } 30 | } 31 | } 32 | } 33 | 34 | //public override void PostActivate (object_base src) 35 | //{ 36 | // Debug.Log("Overridden PostActivate to test " + this.name); 37 | // base.PostActivate(src); 38 | // } 39 | } -------------------------------------------------------------------------------- /UnityScripts/scripts/Traps/a_hack_trap_trespass.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class a_hack_trap_trespass : a_hack_trap { 5 | //A trap that angers nearby npcs if you enter it. 6 | //TODO:The stealth skill should effect this (see skill trap on lvl2 of prison tower) 7 | 8 | public override void ExecuteTrap (object_base src, int triggerX, int triggerY, int State) 9 | { 10 | if (((owner & 0x1f))!=0) 11 | { 12 | SignalTheft(UWCharacter.Instance.transform.position, owner,7f); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Traps/a_hack_trap_unlink.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class a_hack_trap_unlink : a_hack_trap { 5 | //Removes the link on the target object. 6 | public override void ExecuteTrap (object_base src, int triggerX, int triggerY, int State) 7 | { 8 | ObjectInteraction objToUnlink = ObjectLoader.getObjectIntAt(link); 9 | if (objToUnlink!=null) 10 | { 11 | objToUnlink.link=0; 12 | } 13 | } 14 | 15 | public override bool Activate (object_base src,int triggerX, int triggerY, int State) 16 | { 17 | //Do what it needs to do. 18 | ExecuteTrap(this, triggerX,triggerY, State); 19 | 20 | //Unlink traps are always the end of the line so no more activations. 21 | 22 | PostActivate(src); 23 | return true; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Traps/a_hack_trap_vendingselect.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | /// 5 | /// Changes the variable controlling the vending machine selection 6 | /// 7 | public class a_hack_trap_vendingselect : a_hack_trap { 8 | 9 | public override void ExecuteTrap (object_base src, int triggerX, int triggerY, int State) 10 | { 11 | Quest.instance.variables[owner]++; 12 | if (Quest.instance.variables[owner]>=8) 13 | { 14 | Quest.instance.variables[owner]=0; 15 | } 16 | } 17 | 18 | public override void PostActivate (object_base src) 19 | { 20 | Debug.Log("Overridden PostActivate to test " + this.name); 21 | base.PostActivate(src); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Traps/a_hack_trap_visibility.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | /// 5 | /// Makes the linked object to this visible. 6 | /// 7 | public class a_hack_trap_visibility : a_hack_trap 8 | { 9 | public override void ExecuteTrap (object_base src, int triggerX, int triggerY, int State) 10 | { 11 | ObjectInteraction obj = ObjectLoader.getObjectIntAt(link); 12 | if (obj!=null) 13 | { 14 | obj.setInvis(0);//make visible. 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Traps/a_lock.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class a_lock : object_base { 5 | /* 6 | Not really used by uwexporter but does exist in UW. Created here for compatabilty. 7 | The lock acts as a flag to show that a door is locked 8 | */ 9 | public int KeyIndex;//The index of the key that will open this lock. 10 | 11 | protected override void Start() 12 | { 13 | base.Start(); 14 | KeyIndex = link & 0x3F; 15 | } 16 | 17 | //public override void ExecuteTrap (object_base src, int triggerX, int triggerY, int State) 18 | //{ 19 | // if ((flags & 0x1) == 1) 20 | // {//locked 21 | // flags = (short)(flags & 0xE); 22 | // } 23 | // else 24 | // { 25 | // flags = (short)(flags | 0x1); 26 | // } 27 | //} 28 | 29 | 30 | //public override void TriggerNext (int triggerX, int triggerY, int State) 31 | //{ 32 | 33 | //} 34 | 35 | //public override void PostActivate (object_base src) 36 | //{ 37 | // Debug.Log("Overridden PostActivate to test " + this.name); 38 | // base.PostActivate(src); 39 | // } 40 | 41 | 42 | } 43 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Traps/a_null_trap.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | /// 5 | /// /A place holder trap that does nothing but pass along the chain 6 | /// 7 | public class a_null_trap : trap_base 8 | { 9 | 10 | public override void ExecuteTrap(object_base src, int triggerX, int triggerY, int State) 11 | { 12 | 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /UnityScripts/scripts/Traps/a_skill_trap.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class a_skill_trap : trap_base { 5 | 6 | //Does a skill check? 7 | //Quality is the skill to check 8 | 9 | //It is used in level 2 of the prison tower when the guards are annoyed 10 | //It's params are quality =17 (suggests picklock) 11 | //Owner = 7 (min score?) 12 | //Called by an unlock trigger 13 | 14 | //Does this mean the lock requires a skill of at least 7 in pick lock to open??? 15 | //The subsequent trap (a trespass trap) had no effect when player stealth was 30 16 | 17 | 18 | public override void ExecuteTrap (object_base src, int triggerX, int triggerY, int State) 19 | { 20 | //Debug.Log(this.name + " called with params q=" + quality + " o=" + owner); 21 | //base.ExecuteTrap (src, triggerX, triggerY, State); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Traps/a_tell_trap.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class a_tell_trap : trap_base { 5 | 6 | protected override void Start() 7 | { 8 | base.Start(); 9 | Debug.Log("Oh hey a tell trap!"); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Traps/a_variable_trap.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class a_variable_trap : trap_base 5 | { 6 | public int value; 7 | // field bits in value 8 | // ypos 0..2 9 | // owner 3..7 (bit 5 of "owner" seems not to be used) 10 | // quality 8..13 11 | 12 | //public int VariableIndex; 13 | //public int VariableIndex; //currObj.zpos 14 | //public int VariableValue; //((currObj.owner & 0x7) <<3) | (currObj.y )) or maybe 15 | //public int heading; 16 | 17 | protected override void Start() 18 | { 19 | base.Start(); 20 | value = VariableValue(); 21 | } 22 | 23 | 24 | /*public override void PostActivate (object_base src) 25 | { 26 | int TriggerRepeat = (flags>>1) & 0x1; 27 | if (TriggerRepeat==1) 28 | { 29 | DestroyTrap (src); 30 | } 31 | }*/ 32 | 33 | /// 34 | /// Works out the variable the trap uses to set or check against. 35 | /// 36 | /// The value. 37 | public virtual int VariableValue() 38 | { 39 | return ((quality & 0x3f) << 8) | (((owner & 0x1f) << 3) | (ypos & 0x7)); 40 | } 41 | } -------------------------------------------------------------------------------- /UnityScripts/scripts/Traps/an_experience_trap.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | /// 4 | /// An experience trap. 5 | /// 6 | ///Adds experience points to the character. 7 | /// I'm guessing the value in owner. 8 | public class an_experience_trap : trap_base { 9 | 10 | public override void ExecuteTrap (object_base src, int triggerX, int triggerY, int State) 11 | { 12 | UWCharacter.Instance.AddXP(owner); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Triggers/a_look_trigger.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class a_look_trigger : trigger_base { 5 | 6 | /* 7 | Special kind of trigger that fires when the player looks at object linked to it. 8 | Only a limited number of objects support this behaviour. Eg magic orbs, TMAPs 9 | */ 10 | 11 | //TODO: this trigger sometimes uses the search skill (eg hidden switch on level 2 of brittania) 12 | //This is controlled by the zpos of the trap. if Search + 13(?) >= zpos then trigger trap 13 | //in vanilla this is a dice roll. Here it is not. 14 | public override bool Activate(GameObject src) 15 | { 16 | if (zpos>0) 17 | { 18 | if (UWCharacter.Instance.PlayerSkills.GetSkill(Skills.SkillSearch) + Random.Range(0,16) <= zpos) 19 | { 20 | Debug.Log("unable to activate look trigger due to skills"); 21 | return false; 22 | } 23 | } 24 | return base.Activate(src); 25 | } 26 | 27 | /// 28 | /// Force the trigger to fire regardless of skill( used for reveal spell) 29 | /// 30 | /// 31 | public void ForceActivate(GameObject src) 32 | { 33 | base.Activate(src); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Triggers/a_pick_up_trigger.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class a_pick_up_trigger : trigger_base { 5 | /* 6 | A trigger that apparently fires when an object is picked up. Occurs on level 3 in a hidden room. 7 | */ 8 | } 9 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Triggers/a_step_on_trigger.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class a_step_on_trigger : a_move_trigger { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Triggers/an_enter_trigger.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class an_enter_trigger : a_move_trigger { 5 | 6 | protected override void Start () 7 | { 8 | boxDimensions= new Vector3(1.2f,16f,1.2f); 9 | base.Start (); 10 | playerStartedInTrigger = false;//Enter triggers will ignore that the player started within them. See prison lvl 6 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Triggers/an_exit_trigger.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class an_exit_trigger : a_move_trigger { 5 | 6 | protected override void Start () 7 | { 8 | boxDimensions= new Vector3(1.2f,16f,1.2f); 9 | base.Start (); 10 | } 11 | 12 | protected override void OnTriggerEnter (Collider other) 13 | { 14 | 15 | } 16 | 17 | protected override void OnTriggerExit(Collider other) 18 | { 19 | base.OnTriggerEnter(other); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Triggers/an_unlock_trigger.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | 5 | /// 6 | /// Trigger that is called when an object is unlocked. 7 | /// 8 | public class an_unlock_trigger : trigger_base { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Triggers/traptrigger_base.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class traptrigger_base : object_base { 6 | 7 | /// 8 | /// Will the trigger fire. Usually the third bit of the flags (zero based) 9 | /// 10 | /// 11 | public virtual bool WillFire() 12 | { 13 | return (((flags >> 2) & 0x1) == 1); 14 | //return true; 15 | } 16 | 17 | /// 18 | /// The trigger will not delete itself after firing. Usually the second bit of the flags. 19 | /// 20 | public virtual bool WillFireRepeatedly() 21 | { 22 | return ((flags >> 1) & 0x1) == 1; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /UnityScripts/scripts/UI/ChargenButton.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using UnityEngine.UI; 4 | 5 | public class ChargenButton : GuiBase{ 6 | 7 | public Text ButtonText; 8 | public RawImage ButtonImage;//The image displayed if this is a character portrait button. 9 | public Texture2D ButtonOff; 10 | public Texture2D ButtonOn; 11 | public RawImage ButtonBG; 12 | public int Value; 13 | public MainMenuHud SubmitTarget; 14 | static GRLoader ButtonLoader; 15 | 16 | public override void Start() 17 | { 18 | base.Start(); 19 | if (_RES==GAME_UW2) 20 | { 21 | if (ButtonText!=null) 22 | { 23 | ButtonText.color = Color.white; 24 | } 25 | } 26 | } 27 | 28 | public void OnHoverEnter() 29 | { 30 | ButtonBG.texture = ButtonOn; // ButtonLoader.LoadImageAt(ButtonOnIndex,false); 31 | } 32 | 33 | public void OnHoverExit() 34 | { 35 | ButtonBG.texture= ButtonOff; // = ButtonLoader.LoadImageAt(ButtonOffIndex,false); 36 | } 37 | 38 | public virtual void OnClick() 39 | { 40 | SubmitTarget.ButtonClickMainMenu(Value); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /UnityScripts/scripts/UI/ClearRunes.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class ClearRunes : GuiBase { 5 | //Removes the runes that the character has selected. 6 | public void OnClick() 7 | { 8 | if (UWCharacter.Instance!=null) 9 | { 10 | //Debug.Log("Clearing Runes"); 11 | UWCharacter.Instance.PlayerMagic.ActiveRunes[0]=-1; 12 | UWCharacter.Instance.PlayerMagic.ActiveRunes[1]=-1; 13 | UWCharacter.Instance.PlayerMagic.ActiveRunes[2]=-1; 14 | ActiveRuneSlot.UpdateRuneSlots(); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /UnityScripts/scripts/UI/CompassPoint.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using UnityEngine.UI; 4 | 5 | public class CompassPoint : GuiBase { 6 | 7 | public int index; 8 | 9 | public override void Start () 10 | { 11 | this.GetComponent().texture=GameWorldController.instance.grCompass.LoadImageAt(index); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /UnityScripts/scripts/UI/ConversationButton.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using TMPro; 5 | 6 | public class ConversationButton : GuiBase{ 7 | 8 | public int option; 9 | 10 | public void OnClick() 11 | { 12 | if (ConversationVM.WaitingForInput) 13 | { 14 | ConversationVM.instance.CheckAnswer(option); 15 | } 16 | } 17 | 18 | public void SetText(string text) 19 | { 20 | this.GetComponent().text = text; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /UnityScripts/scripts/UI/GuiBase.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using UnityEngine.UI; 4 | 5 | /// 6 | /// GUI base. 7 | /// 8 | /// Base class for UI components. Allows moving of elements and sets up common references. 9 | /// 10 | public class GuiBase : UWEBase { 11 | public Vector3 anchorPos; 12 | public virtual void Start() 13 | { 14 | 15 | } 16 | 17 | 18 | public virtual void Update() 19 | { 20 | if (this.GetComponent()!=null) 21 | { 22 | anchorPos =this.GetComponent().anchoredPosition; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /UnityScripts/scripts/UI/HUD.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using UnityEngine.UI; 4 | 5 | public class HUD : UWEBase { 6 | 7 | //The cursor to display on the gui 8 | [Header("Cursor Icons")] 9 | public RawImage FreeLookCursor; 10 | public RawImage MouseLookCursor; 11 | public Texture2D CursorIcon 12 | { 13 | get 14 | { 15 | return _CursorIcon; 16 | } 17 | set 18 | { 19 | _CursorIcon = value; 20 | FreeLookCursor.texture = value; 21 | MouseLookCursor.texture = value; 22 | } 23 | } 24 | private Texture2D _CursorIcon; 25 | public Texture2D CursorIconDefault; 26 | public Texture2D CursorIconBlank; 27 | public Texture2D CursorIconTarget; //Default Cursor for ranged spells and combat. 28 | 29 | 30 | public Text LoadingProgress; 31 | 32 | } 33 | -------------------------------------------------------------------------------- /UnityScripts/scripts/UI/Hud_Hover.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class Hud_Hover : MonoBehaviour { 5 | //No longer in use 6 | /*private UILabel MessageLog; 7 | public int InteractionMode; 8 | // Use this for initialization 9 | void Start () { 10 | MessageLog = (UILabel)GameObject.FindWithTag("MessageLog").GetComponent(); 11 | } 12 | 13 | 14 | void OnClick() 15 | { 16 | UWCharacter.InteractionMode=InteractionMode; 17 | MessageLog.text="Interaction mode is now " + name + "("+InteractionMode+")"; 18 | } 19 | */ 20 | } 21 | -------------------------------------------------------------------------------- /UnityScripts/scripts/UI/LevelTeleportButton.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class LevelTeleportButton : GuiBase { 6 | 7 | public GameWorldController.UW2_LevelNos levelToLoad; 8 | 9 | public void Load() 10 | { 11 | GameWorldController.instance.SwitchLevel((short)levelToLoad); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /UnityScripts/scripts/UI/MainMenuButton.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using UnityEngine.UI; 4 | 5 | public class MainMenuButton : GuiBase { 6 | public int ButtonOffIndex; 7 | public int ButtonOnIndex; 8 | public RawImage ButtonBG; 9 | public int Value; 10 | public MainMenuHud SubmitTarget; 11 | static GRLoader ButtonLoader; 12 | 13 | public override void Start () 14 | { 15 | switch (_RES) 16 | { 17 | case GAME_UWDEMO: 18 | return; 19 | default: 20 | if (ButtonLoader== null) 21 | { 22 | ButtonLoader= new GRLoader(GRLoader.OPBTN_GR); 23 | ButtonLoader.PaletteNo=6; 24 | } 25 | ButtonBG.texture= ButtonLoader.LoadImageAt(ButtonOffIndex,false); 26 | break; 27 | } 28 | } 29 | 30 | public void OnHoverEnter() 31 | { 32 | ButtonBG.texture = ButtonLoader.LoadImageAt(ButtonOnIndex,false); 33 | } 34 | 35 | public void OnHoverExit() 36 | { 37 | ButtonBG.texture = ButtonLoader.LoadImageAt(ButtonOffIndex,false); 38 | } 39 | 40 | public virtual void OnClick() 41 | { 42 | SubmitTarget.ButtonClickMainMenu(Value); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /UnityScripts/scripts/UI/MapClose.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class MapClose : MonoBehaviour { 5 | 6 | public void OnClick() 7 | { 8 | Time.timeScale = 1f; 9 | WindowDetect.InMap=false; 10 | if (MusicController.instance!=null) 11 | { 12 | MusicController.instance.InMap=false; 13 | } 14 | UWHUD.instance.RefreshPanels(UWHUD.HUD_MODE_INVENTORY); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /UnityScripts/scripts/UI/MapNote.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | /// 4 | /// Map note. Storage for map notes 5 | /// 6 | public class MapNote : UWClass { 7 | //public Vector2 NotePosition; 8 | public string NoteText; 9 | public System.Guid guid; 10 | public int PosX; 11 | public int PosY; 12 | 13 | public MapNote(int posX, int posY, string noteText) 14 | { 15 | PosX = posX; 16 | PosY = posY; 17 | NoteText = noteText; 18 | guid = System.Guid.NewGuid(); 19 | } 20 | 21 | public Vector2 NotePosition() 22 | { 23 | return new Vector2((float)PosX,(float)PosY-100f); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /UnityScripts/scripts/UI/MapNoteId.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | /// 5 | /// Used to associate map note ui elements with the Map note information 6 | /// 7 | public class MapNoteId : MonoBehaviour{ 8 | 9 | public System.Guid guid; 10 | 11 | public void OnClick() 12 | { 13 | if (MapInteraction.InteractionMode == 1) 14 | { 15 | //delete the mapnote 16 | for (int i =0; i< GameWorldController.instance.AutoMaps[MapInteraction.MapNo].MapNotes.Count;i++) 17 | { 18 | if (guid== GameWorldController.instance.AutoMaps[MapInteraction.MapNo].MapNotes[i].guid) 19 | { 20 | GameWorldController.instance.AutoMaps[MapInteraction.MapNo].MapNotes.RemoveAt(i); 21 | Destroy(this.gameObject); 22 | return; 23 | } 24 | } 25 | 26 | } 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /UnityScripts/scripts/UI/MapWorldSelect.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | 6 | public class MapWorldSelect : GuiBase { 7 | public GameWorldController.Worlds world; 8 | 9 | public Texture2D ButtonOff; 10 | public Texture2D ButtonOn; 11 | public int teleportWorldIndex = 0; 12 | 13 | public void OnClick() 14 | { 15 | MapInteraction.instance.CurrentWorld = world; 16 | MapInteraction.UpdateMap((int)world); 17 | } 18 | 19 | public void SetOn() 20 | { 21 | this.GetComponent().texture = ButtonOn; 22 | } 23 | 24 | public void SetOff() 25 | { 26 | this.GetComponent().texture = ButtonOff; 27 | } 28 | 29 | public void TravelToWorld() 30 | { 31 | a_hack_trap_teleport.instance.TravelDirect(teleportWorldIndex); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /UnityScripts/scripts/UI/MouseLocker.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class MouseLocker : MonoBehaviour { 5 | //Not in use? 6 | /* private MouseLook XAxis; 7 | private MouseLook YAxis; 8 | private bool MouseLookEnabled; 9 | private GameObject MainCam; 10 | // Use this for initialization 11 | void Start () { 12 | //MainCam=GameObject.Find("Main Camera"); 13 | XAxis = GetComponent(); 14 | YAxis = transform.FindChild ("Main Camera").GetComponent(); 15 | Screen.lockCursor=true; 16 | } 17 | 18 | // Update is called once per frame 19 | void Update() 20 | { 21 | if (Input.GetKey(KeyCode.E)) 22 | { 23 | if (MouseLookEnabled==true) 24 | { 25 | 26 | Screen.lockCursor = true; 27 | XAxis.enabled=true; 28 | YAxis.enabled=true; 29 | MouseLookEnabled=false; 30 | } 31 | else 32 | { 33 | Screen.lockCursor = false; 34 | XAxis.enabled=false; 35 | YAxis.enabled=false; 36 | MouseLookEnabled=true; 37 | } 38 | 39 | } 40 | 41 | }*/ 42 | } 43 | -------------------------------------------------------------------------------- /UnityScripts/scripts/UI/MouseTracker.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class MouseTracker : MonoBehaviour { 5 | 6 | // Use this for initialization 7 | void Start () { 8 | 9 | } 10 | 11 | // Update is called once per frame 12 | void Update () { 13 | 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /UnityScripts/scripts/UI/NovaLevelSelect.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using UnityEngine.UI; 4 | using System.IO; 5 | using System.Text; 6 | 7 | public class NovaLevelSelect : GuiBase { 8 | public Dropdown Select; 9 | public static string MapSelected; 10 | string[] pFiles; 11 | 12 | public override void Start () 13 | { 14 | base.Start (); 15 | //if (File.Exists(GameWorldController.instance.path_tnova)) //(File.Exists(Application.dataPath + "//..//tnova_path.txt")) 16 | // { 17 | //string fileName = Application.dataPath + "//..//tnova_path.txt"; 18 | //'StreamReader fileReader = new StreamReader(fileName, Encoding.Default); 19 | //string NovaPath=fileReader.ReadLine().TrimEnd() + "Maps"; 20 | if (Directory.Exists(GameWorldController.instance.path_tnova + "Maps")) 21 | { 22 | pFiles = Directory.GetFiles(GameWorldController.instance.path_tnova + "Maps"); 23 | for (int i = 0; i <= pFiles.GetUpperBound(0); i++) 24 | { 25 | Select.options.Add(new Dropdown.OptionData(Path.GetFileName(pFiles[i]))); 26 | } 27 | } 28 | 29 | //} 30 | } 31 | 32 | public void SelectOption() 33 | { 34 | MapSelected=pFiles[Select.value]; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /UnityScripts/scripts/UI/SaveGameButton.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using UnityEngine.UI; 4 | 5 | public class SaveGameButton : GuiBase { 6 | 7 | public MainMenuHud SubmitTarget; 8 | public int slotNo; 9 | 10 | public static Color32 On = new Color32(255,213,64,255) ; 11 | public static Color32 Off = new Color32(187,123,1,255) ; 12 | 13 | 14 | public Text label; 15 | 16 | public override void Start() 17 | { 18 | base.Start(); 19 | label.color= SaveGameButton.Off; 20 | } 21 | 22 | 23 | public void OnHoverEnter() 24 | { 25 | //ButtonBG.texture=ButtonOn; 26 | label.color= SaveGameButton.On; 27 | 28 | } 29 | 30 | public void OnHoverExit() 31 | { 32 | //ButtonBG.texture=ButtonOff; 33 | label.color= SaveGameButton.Off; 34 | } 35 | 36 | public virtual void OnClick() 37 | { 38 | SubmitTarget.LoadSave(slotNo); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /UnityScripts/scripts/UI/ScrollButtonInventory.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class ScrollButtonInventory : Scrollbutton 5 | { 6 | public short stepSize; 7 | public static short ScrollValue = 0; 8 | public short MaxScrollValue; 9 | public short MinScrollValue; 10 | 11 | private int previousScrollValue = -1; 12 | 13 | public void OnClick() 14 | { 15 | ScrollValue = (short)(ScrollValue + stepSize); 16 | int noOfItems = UWCharacter.Instance.playerInventory.currentContainer.CountItems(); 17 | MaxScrollValue = (short)(Mathf.Max((((noOfItems)/ 4)-1) * 4,8)); 18 | if (ScrollValue > MaxScrollValue) 19 | { 20 | ScrollValue = MaxScrollValue; 21 | } 22 | 23 | if (ScrollValue < MinScrollValue) 24 | { 25 | ScrollValue = MinScrollValue; 26 | } 27 | } 28 | 29 | // Update is called once per frame 30 | public override void Update() 31 | { 32 | base.Update(); 33 | if (ScrollValue != previousScrollValue) 34 | { 35 | previousScrollValue = ScrollValue; 36 | UWCharacter.Instance.playerInventory.ContainerOffset = ScrollValue; 37 | UWCharacter.Instance.playerInventory.Refresh(); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /UnityScripts/scripts/UI/ScrollButtonStatsDisplay.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class ScrollButtonStatsDisplay : Scrollbutton { 5 | 6 | private int PreviousValue=-1; 7 | public int stepSize; 8 | public static int ScrollValue=0; 9 | public int MaxScrollValue; 10 | public int MinScrollValue; 11 | 12 | public void OnClick() 13 | { 14 | ScrollValue = ScrollValue + stepSize; 15 | if (ScrollValue >MaxScrollValue) 16 | { 17 | ScrollValue=MaxScrollValue; 18 | } 19 | 20 | if (ScrollValue MaxScrollValue) 15 | { 16 | ScrollValue=MaxScrollValue; 17 | } 18 | 19 | if (ScrollValue ().texture=Chains.LoadImageAt(0); 15 | } 16 | 17 | public void OnClick() 18 | { 19 | if (Dragging==true){return;} 20 | if (UWHUD.instance.isRotating==true){return;} 21 | 22 | switch (ActiveControl) 23 | { 24 | case UWHUD.HUD_MODE_INVENTORY://Inventory -> Stats 25 | ActiveControl=UWHUD.HUD_MODE_STATS; 26 | break; 27 | case UWHUD.HUD_MODE_STATS://Stats -> Inventory 28 | ActiveControl=UWHUD.HUD_MODE_INVENTORY; 29 | break; 30 | case UWHUD.HUD_MODE_RUNES://Magic -> Inventory 31 | ActiveControl=UWHUD.HUD_MODE_INVENTORY; 32 | break; 33 | default://Not a valid state to switch from 34 | return; 35 | } 36 | Refresh(); 37 | } 38 | 39 | public void Refresh() 40 | { 41 | UWHUD.instance.RefreshPanels(ActiveControl); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /UnityScripts/scripts/UnderworldGenerator/GeneratorClasses.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class GeneratorClasses : UWClass { 6 | 7 | public int index; 8 | public int Style;//Unimplemented. What type of room is created. Eg cave, throne room, treasure room, pit, monster lair, 9 | 10 | 11 | public static bool RandomPercent(int percent) 12 | { 13 | return (percent >= Random.Range(1, 101)); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /UnityScripts/scripts/UnderworldGenerator/GeneratorMap.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class GeneratorMap : GeneratorClasses { 6 | 7 | //Defines the properties of a tile in the map generator. 8 | public int RoomMap; //What room is in this tile 9 | public int TileLayoutMap; //what tile type is at the tile. Currently only solid or open. 10 | public int JunctionMap; //Does this tile contain a junction and how many corridors meet here. 11 | public int FloorHeight;//Unimplemented. 12 | public int FloorTexture; 13 | public int WallTexture; 14 | public bool isDiag; //Is the tile a candidate for a diagonal tile 15 | public bool isSlope; //Is the tile a candidate for a slope 16 | 17 | 18 | } 19 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Utility/Billboard.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | /// 4 | /// Billboard sprites so they always face the player. 5 | /// 6 | public class Billboard : MonoBehaviour 7 | { 8 | 9 | void Update() 10 | { 11 | if (Vector3.Distance(this.transform.position, UWCharacter.Instance.CameraPos)<=8) 12 | {//Only rotate nearby objects. 13 | 14 | if (UWCharacter.Instance.dir!=Vector3.zero) 15 | { 16 | //transform.rotation = Quaternion.LookRotation(UWCharacter.Instance.dir,Vector3.up); 17 | transform.rotation = Quaternion.LookRotation(UWCharacter.Instance.dirForNPC); 18 | } 19 | 20 | //based on http://answers.unity3d.com/questions/524087/tweaking-sprite-billboard.html 21 | 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /UnityScripts/scripts/Utility/BillboardNPC.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class BillboardNPC : Billboard { 5 | 6 | void Update() 7 | { 8 | if (Vector3.Distance(this.transform.position, UWCharacter.Instance.CameraPos)<=8) 9 | {//Only rotate nearby objects. 10 | 11 | if (UWCharacter.Instance.dir!=Vector3.zero) 12 | { 13 | transform.rotation = Quaternion.LookRotation(UWCharacter.Instance.dirForNPC); 14 | } 15 | 16 | //based on http://answers.unity3d.com/questions/524087/tweaking-sprite-billboard.html 17 | 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Utility/PersistObject.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | /// 5 | /// Makes sure the object persists. 6 | /// 7 | public class PersistObject : UWEBase { 8 | void Awake () { 9 | DontDestroyOnLoad(gameObject); 10 | } 11 | } -------------------------------------------------------------------------------- /UnityScripts/scripts/Utility/RemoteCameraRender.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class RemoteCameraRender : MonoBehaviour { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Utility/ShockStartup.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class ShockStartup : MonoBehaviour { 5 | public StringController StringControl; 6 | 7 | void Awake() 8 | { 9 | StringControl=new StringController(); 10 | StringController.instance.InitStringController("c:\\shock_strings.txt"); 11 | //Debug.Log (StringController.instance.GetString (2151,037)); 12 | Words.sc=StringControl; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /UnityScripts/scripts/Utility/UWClass.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.IO; 4 | 5 | public class UWClass { 6 | public static char sep;//File name seperator for linux/windows support 7 | 8 | public const string GAME_UWDEMO = "UW0"; 9 | public const string GAME_UW1 = "UW1"; 10 | public const string GAME_UW2 = "UW2"; 11 | public const string GAME_SHOCK = "SHOCK"; 12 | public const string GAME_TNOVA = "TNOVA"; 13 | 14 | public static string _RES="UW1"; 15 | 16 | /// 17 | /// Gets the current object list in use 18 | /// 19 | /// 20 | public static ObjectLoader CurrentObjectList() 21 | { 22 | return UWEBase.CurrentObjectList(); 23 | } 24 | 25 | /// 26 | /// Returns the current tile map 27 | /// 28 | /// The tile map. 29 | public static TileMap CurrentTileMap() 30 | { 31 | return UWEBase.CurrentTileMap(); 32 | } 33 | 34 | public static AutoMap CurrentAutoMap() 35 | { 36 | return UWEBase.CurrentAutoMap(); 37 | } 38 | 39 | 40 | public static string CleanPath(string PathIn) 41 | { 42 | return PathIn.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar) + Path.DirectorySeparatorChar; 43 | } 44 | 45 | 46 | } 47 | -------------------------------------------------------------------------------- /UnityScripts/scripts/World/TileContactLava.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class TileContactLava : TileContact { 5 | 6 | /// 7 | /// Handles throwing objects into lava. 8 | /// 9 | /// 10 | /// 11 | /// Does not include handling of the talismans which use the larger shrine lava trigger. 12 | protected override void TileContactEvent (ObjectInteraction obj, Vector3 position) 13 | { 14 | if (obj.item_id!=456) 15 | { 16 | Impact.SpawnHitImpact(456, position, 9, 12); 17 | if (IsObjectDestroyable(obj)) 18 | { 19 | ObjectInteraction.DestroyObjectFromUW(obj); 20 | } 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /UnityScripts/scripts/World/TileContactMud.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | /// 7 | /// Used for throwing objects into special mud in UW2 8 | /// 9 | public class TileContactMud : TileContactWater { 10 | 11 | 12 | protected override void TileContactEvent(ObjectInteraction obj, Vector3 position) 13 | { 14 | switch (obj.item_id) 15 | { 16 | case 230: 17 | if(obj.link==579) 18 | {//Potion of basilisk oil 19 | BasiliskOilOnMud(obj); 20 | } 21 | break; 22 | } 23 | base.TileContactEvent(obj, position); 24 | } 25 | 26 | /// 27 | /// Handles throwing basilisk oil into the mud in UW2. 28 | /// 29 | /// 30 | void BasiliskOilOnMud(ObjectInteraction obj) 31 | { 32 | if (Quest.instance.x_clocks[3]<2) 33 | {//Advance the xclock tracking quest progress. 34 | Quest.instance.x_clocks[3] = 2; 35 | //000~001~332~The thick oil permeates the mud. \n 36 | UWHUD.instance.MessageScroll.Add(StringController.instance.GetString(1, 332)); 37 | } 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /assets/guis/assets/shock/logs/logs.txt: -------------------------------------------------------------------------------- 1 | Portraits for the logs go here. -------------------------------------------------------------------------------- /assets/guis/assets/shock/screens/screens.txt: -------------------------------------------------------------------------------- 1 | The animation frames for the screens go here. -------------------------------------------------------------------------------- /assets/guis/assets/shock/switches/switches.txt: -------------------------------------------------------------------------------- 1 | The switch art goes here. -------------------------------------------------------------------------------- /assets/guis/readables/log.gui: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hankmorgan/UnderworldExporter/64f5c2310e95c2e507725b9c69955e645b80de0b/assets/guis/readables/log.gui -------------------------------------------------------------------------------- /assets/guis/readables/shock_transparent_world.gui: -------------------------------------------------------------------------------- 1 | #define WORLD_DISPLAY 2 | #include "guis/readables/shock_transparent.gui" -------------------------------------------------------------------------------- /assets/guis/shock/cam.gui: -------------------------------------------------------------------------------- 1 | windowDef Desktop 2 | { 3 | rect 0,0,640,480 4 | nocursor 1 5 | 6 | windowdef panel 7 | { 8 | rect 0,0,640,480 9 | visible 1 10 | background "textures/cameraView1"; 11 | 12 | onTime 0{ 13 | set background "textures/cameraView1"; 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /assets/guis/shock/switch.gui: -------------------------------------------------------------------------------- 1 | windowDef Desktop 2 | { 3 | rect 0,0,640,480 4 | nocursor 1 5 | float buttonstate 0 6 | windowdef panel 7 | { 8 | rect 0,0,640,480 9 | visible 1 10 | background "guis/assets/shock/screens/0886"; 11 | 12 | onTime 0{ 13 | if ("gui::buttonstate"==1) 14 | { 15 | set "background" "guis/assets/shock/switches/1350_0887"; //On State 16 | } 17 | else 18 | { 19 | set "background" "guis/assets/shock/switches/1350_0886"; //Off State 20 | } 21 | 22 | } 23 | onTime 500{ 24 | resetTime "0"; 25 | 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /assets/guis/shock/switch_9_0_0.gui: -------------------------------------------------------------------------------- 1 | windowDef Desktop 2 | { 3 | rect 0,0,640,480 4 | nocursor 1 5 | float buttonstate 0 6 | windowdef panel 7 | { 8 | rect 0,0,640,480 9 | visible 1 10 | background "guis/assets/shock/screens/0886"; 11 | 12 | onTime 0{ 13 | if ("gui::buttonstate"==1) 14 | { 15 | 16 | set "background" "guis/assets/shock/switches/1350_0887"; //On State 17 | } 18 | else 19 | { 20 | set "background" "guis/assets/shock/switches/1350_0886"; //Off State 21 | 22 | } 23 | } 24 | onTime 500{ 25 | resetTime "0"; 26 | 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /assets/guis/shock/switch_9_0_1.gui: -------------------------------------------------------------------------------- 1 | windowDef Desktop 2 | { 3 | rect 0,0,640,480 4 | nocursor 1 5 | float buttonstate 0 6 | windowdef panel 7 | { 8 | rect 0,0,640,480 9 | visible 1 10 | background "guis/assets/shock/screens/0887"; 11 | 12 | onTime 0{ 13 | if ("gui::buttonstate"==1) 14 | { 15 | set "background" "guis/assets/shock/switches/1350_0886"; //On State 16 | } 17 | else 18 | { 19 | set "background" "guis/assets/shock/switches/1350_0887"; //Off State 20 | } 21 | 22 | } 23 | onTime 500{ 24 | resetTime "0"; 25 | 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /assets/guis/shock/switch_9_0_2.gui: -------------------------------------------------------------------------------- 1 | windowDef Desktop 2 | { 3 | rect 0,0,640,480 4 | nocursor 1 5 | float buttonstate 0 6 | windowdef panel 7 | { 8 | rect 0,0,640,480 9 | visible 1 10 | background "guis/assets/shock/screens/0894"; 11 | 12 | onTime 0{ 13 | if ("gui::buttonstate"==1) 14 | { 15 | set "background" "guis/assets/shock/switches/1350_0895"; //On State 16 | } 17 | else 18 | { 19 | set "background" "guis/assets/shock/switches/1350_0894"; //Off State 20 | } 21 | } 22 | onTime 500{ 23 | resetTime "0"; 24 | 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /assets/guis/shock/switch_9_0_3.gui: -------------------------------------------------------------------------------- 1 | windowDef Desktop 2 | { 3 | rect 0,0,640,480 4 | nocursor 1 5 | float buttonstate 0 6 | windowdef panel 7 | { 8 | rect 0,0,640,480 9 | visible 1 10 | background "guis/assets/shock/screens/0895"; 11 | 12 | onTime 0{ 13 | if ("gui::buttonstate"==1) 14 | { 15 | set "background" "guis/assets/shock/switches/1350_0894"; //On State 16 | } 17 | else 18 | { 19 | set "background" "guis/assets/shock/switches/1350_0895"; //Off State 20 | } 21 | } 22 | onTime 500{ 23 | resetTime "0"; 24 | 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /assets/guis/shock/switch_9_0_4.gui: -------------------------------------------------------------------------------- 1 | windowDef Desktop 2 | { 3 | rect 0,0,640,480 4 | nocursor 1 5 | float buttonstate 0 6 | windowdef panel 7 | { 8 | rect 0,0,640,480 9 | visible 1 10 | background "guis/assets/shock/screens/0902"; 11 | 12 | onTime 0{ 13 | if ("gui::buttonstate"==1) 14 | { 15 | set "background" "guis/assets/shock/switches/1350_0903"; //On State 16 | } 17 | else 18 | { 19 | set "background" "guis/assets/shock/switches/1350_0902"; //Off State 20 | } 21 | } 22 | onTime 500{ 23 | resetTime "0"; 24 | 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /assets/guis/shock/switch_9_0_5.gui: -------------------------------------------------------------------------------- 1 | windowDef Desktop 2 | { 3 | rect 0,0,640,480 4 | nocursor 1 5 | float buttonstate 0 6 | windowdef panel 7 | { 8 | rect 0,0,640,480 9 | visible 1 10 | background "guis/assets/shock/screens/0903"; 11 | 12 | onTime 0{ 13 | if ("gui::buttonstate"==1) 14 | { 15 | set "background" "guis/assets/shock/switches/1350_0902"; //On State 16 | } 17 | else 18 | { 19 | set "background" "guis/assets/shock/switches/1350_0903"; //Off State 20 | } 21 | } 22 | onTime 500{ 23 | resetTime "0"; 24 | 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /assets/guis/shock/switch_9_0_6.gui: -------------------------------------------------------------------------------- 1 | windowDef Desktop 2 | { 3 | rect 0,0,640,480 4 | nocursor 1 5 | float buttonstate 0 6 | windowdef panel 7 | { 8 | rect 0,0,640,480 9 | visible 1 10 | background "guis/assets/shock/screens/0906"; 11 | 12 | onTime 0{ 13 | if ("gui::buttonstate"==1) 14 | { 15 | set "background" "guis/assets/shock/switches/1350_0907"; //On State 16 | } 17 | else 18 | { 19 | set "background" "guis/assets/shock/switches/1350_0906"; //Off State 20 | } 21 | 22 | } 23 | onTime 500{ 24 | resetTime "0"; 25 | 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /assets/guis/shock/switch_9_0_7.gui: -------------------------------------------------------------------------------- 1 | windowDef Desktop 2 | { 3 | rect 0,0,640,480 4 | nocursor 1 5 | float buttonstate 0 6 | windowdef panel 7 | { 8 | rect 0,0,640,480 9 | visible 1 10 | background "guis/assets/shock/screens/0910"; 11 | 12 | onTime 0{ 13 | if ("gui::buttonstate"==1) 14 | { 15 | set "background" "guis/assets/shock/switches/1350_0911"; //On State 16 | } 17 | else 18 | { 19 | set "background" "guis/assets/shock/switches/1350_0910"; //Off State 20 | } 21 | } 22 | onTime 500{ 23 | resetTime "0"; 24 | 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /assets/guis/shock/switch_9_3_0.gui: -------------------------------------------------------------------------------- 1 | windowDef Desktop 2 | { 3 | rect 0,0,640,480 4 | nocursor 1 5 | float buttonstate 0 6 | windowdef panel 7 | { 8 | rect 0,0,640,480 9 | visible 1 10 | background "guis/assets/shock/screens/0959"; 11 | 12 | onTime 0{ 13 | if ("gui::buttonstate"==1) 14 | { 15 | set "background" "guis/assets/shock/switches/1350_0961"; //On State 16 | } 17 | else 18 | { 19 | set "background" "guis/assets/shock/switches/1350_0959"; //Off State 20 | } 21 | } 22 | onTime 500{ 23 | resetTime "0"; 24 | 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /assets/guis/shock/switch_9_3_1.gui: -------------------------------------------------------------------------------- 1 | windowDef Desktop 2 | { 3 | rect 0,0,640,480 4 | nocursor 1 5 | float buttonstate 0 6 | windowdef panel 7 | { 8 | rect 0,0,640,480 9 | visible 1 10 | background "guis/assets/shock/screens/0964"; 11 | 12 | onTime 0{ 13 | if ("gui::buttonstate"==1) 14 | { 15 | 16 | set "background" "guis/assets/shock/switches/1350_0966"; //On State 17 | } 18 | else 19 | { 20 | set "background" "guis/assets/shock/switches/1350_0964"; //Off State 21 | 22 | } 23 | } 24 | onTime 500{ 25 | resetTime "0"; 26 | 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /assets/guis/shock/switch_9_3_10.gui: -------------------------------------------------------------------------------- 1 | windowDef Desktop 2 | { 3 | rect 0,0,640,480 4 | nocursor 1 5 | float buttonstate 0 6 | windowdef panel 7 | { 8 | rect 0,0,640,480 9 | visible 1 10 | background "guis/assets/shock/screens/1004"; 11 | 12 | onTime 0{ 13 | if ("gui::buttonstate"==1) 14 | { 15 | 16 | set "background" "guis/assets/shock/switches/1350_1005"; //On State 17 | } 18 | else 19 | { 20 | set "background" "guis/assets/shock/switches/1350_1004"; //Off State 21 | 22 | } 23 | } 24 | onTime 500{ 25 | resetTime "0"; 26 | 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /assets/guis/shock/switch_9_3_2.gui: -------------------------------------------------------------------------------- 1 | windowDef Desktop 2 | { 3 | rect 0,0,640,480 4 | nocursor 1 5 | float buttonstate 0 6 | windowdef panel 7 | { 8 | rect 0,0,640,480 9 | visible 1 10 | background "guis/assets/shock/screens/0969"; 11 | 12 | onTime 0{ 13 | if ("gui::buttonstate"==1) 14 | { 15 | 16 | set "background" "guis/assets/shock/switches/1350_0971"; //On State 17 | } 18 | else 19 | { 20 | set "background" "guis/assets/shock/switches/1350_0969"; //Off State 21 | 22 | } 23 | } 24 | onTime 500{ 25 | resetTime "0"; 26 | 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /assets/guis/shock/switch_9_3_3.gui: -------------------------------------------------------------------------------- 1 | windowDef Desktop 2 | { 3 | rect 0,0,640,480 4 | nocursor 1 5 | float buttonstate 0 6 | windowdef panel 7 | { 8 | rect 0,0,640,480 9 | visible 1 10 | background "guis/assets/shock/screens/0974"; 11 | 12 | onTime 0{ 13 | if ("gui::buttonstate"==1) 14 | { 15 | 16 | set "background" "guis/assets/shock/switches/1350_0976"; //On State 17 | } 18 | else 19 | { 20 | set "background" "guis/assets/shock/switches/1350_0974"; //Off State 21 | 22 | } 23 | } 24 | onTime 500{ 25 | resetTime "0"; 26 | 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /assets/guis/shock/switch_9_3_4.gui: -------------------------------------------------------------------------------- 1 | windowDef Desktop 2 | { 3 | rect 0,0,640,480 4 | nocursor 1 5 | float buttonstate 0 6 | windowdef panel 7 | { 8 | rect 0,0,640,480 9 | visible 1 10 | background "guis/assets/shock/screens/0979"; 11 | 12 | onTime 0{ 13 | if ("gui::buttonstate"==1) 14 | { 15 | 16 | set "background" "guis/assets/shock/switches/1350_0980"; //On State 17 | } 18 | else 19 | { 20 | set "background" "guis/assets/shock/switches/1350_0979"; //Off State 21 | 22 | } 23 | } 24 | onTime 500{ 25 | resetTime "0"; 26 | 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /assets/guis/shock/switch_9_3_5.gui: -------------------------------------------------------------------------------- 1 | windowDef Desktop 2 | { 3 | rect 0,0,640,480 4 | nocursor 1 5 | float buttonstate 0 6 | windowdef panel 7 | { 8 | rect 0,0,640,480 9 | visible 1 10 | background "guis/assets/shock/screens/0983"; 11 | 12 | onTime 0{ 13 | if ("gui::buttonstate"==1) 14 | { 15 | 16 | set "background" "guis/assets/shock/switches/1350_0984"; //On State 17 | } 18 | else 19 | { 20 | set "background" "guis/assets/shock/switches/1350_0983"; //Off State 21 | 22 | } 23 | } 24 | onTime 500{ 25 | resetTime "0"; 26 | 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /assets/guis/shock/switch_9_3_6.gui: -------------------------------------------------------------------------------- 1 | windowDef Desktop 2 | { 3 | rect 0,0,640,480 4 | nocursor 1 5 | float buttonstate 0 6 | windowdef panel 7 | { 8 | rect 0,0,640,480 9 | visible 1 10 | background "guis/assets/shock/screens/0987"; 11 | 12 | onTime 0{ 13 | if ("gui::buttonstate"==1) 14 | { 15 | 16 | set "background" "guis/assets/shock/switches/1350_0988"; //On State 17 | } 18 | else 19 | { 20 | set "background" "guis/assets/shock/switches/1350_0987"; //Off State 21 | 22 | } 23 | } 24 | onTime 500{ 25 | resetTime "0"; 26 | 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /assets/guis/shock/switch_9_3_7.gui: -------------------------------------------------------------------------------- 1 | windowDef Desktop 2 | { 3 | rect 0,0,640,480 4 | nocursor 1 5 | float buttonstate 0 6 | windowdef panel 7 | { 8 | rect 0,0,640,480 9 | visible 1 10 | background "guis/assets/shock/screens/0992"; 11 | 12 | onTime 0{ 13 | if ("gui::buttonstate"==1) 14 | { 15 | set "background" "guis/assets/shock/switches/1350_0991"; //On State 16 | } 17 | else 18 | { 19 | set "background" "guis/assets/shock/switches/1350_0992"; //Off State 20 | } 21 | } 22 | onTime 500{ 23 | resetTime "0"; 24 | 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /assets/guis/shock/switch_9_3_8.gui: -------------------------------------------------------------------------------- 1 | windowDef Desktop 2 | { 3 | rect 0,0,640,480 4 | nocursor 1 5 | float buttonstate 0 6 | windowdef panel 7 | { 8 | rect 0,0,640,480 9 | visible 1 10 | background "guis/assets/shock/screens/0996"; 11 | 12 | onTime 0{ 13 | if ("gui::buttonstate"==1) 14 | { 15 | 16 | set "background" "guis/assets/shock/switches/1350_0995"; //On State 17 | } 18 | else 19 | { 20 | set "background" "guis/assets/shock/switches/1350_0996"; //Off State 21 | 22 | } 23 | } 24 | onTime 500{ 25 | resetTime "0"; 26 | 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /assets/guis/shock/switch_9_3_9.gui: -------------------------------------------------------------------------------- 1 | windowDef Desktop 2 | { 3 | rect 0,0,640,480 4 | nocursor 1 5 | float buttonstate 0 6 | windowdef panel 7 | { 8 | rect 0,0,640,480 9 | visible 1 10 | background "guis/assets/shock/screens/0999"; 11 | 12 | onTime 0{ 13 | if ("gui::buttonstate"==1) 14 | { 15 | 16 | set "background" "guis/assets/shock/switches/1350_1000"; //On State 17 | } 18 | else 19 | { 20 | set "background" "guis/assets/shock/switches/1350_0999"; //Off State 21 | 22 | } 23 | } 24 | onTime 500{ 25 | resetTime "0"; 26 | 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /assets/materials/materials.txt: -------------------------------------------------------------------------------- 1 | The material files for the textures goes here. -------------------------------------------------------------------------------- /assets/sound/sfx/shock_barks/shock_barks.txt: -------------------------------------------------------------------------------- 1 | Computer voice barks go here -------------------------------------------------------------------------------- /assets/sound/sfx/shock_logs/shock_logs.txt: -------------------------------------------------------------------------------- 1 | The audio logs go here -------------------------------------------------------------------------------- /assets/sound/sound.txt: -------------------------------------------------------------------------------- 1 | The Sound shaders for the logs and the barks goes here. -------------------------------------------------------------------------------- /assets/textures/shock/shock_textures.txt: -------------------------------------------------------------------------------- 1 | The tga files for the Shock textures goes here. -------------------------------------------------------------------------------- /assets/textures/uw1/uw1 textures.txt: -------------------------------------------------------------------------------- 1 | The tga files for the uw1 textures goes here. -------------------------------------------------------------------------------- /assets/textures/uw2/uw2 textures.txt: -------------------------------------------------------------------------------- 1 | The tga files for the UW2 textures goes here. -------------------------------------------------------------------------------- /assets/xdata/key.xd: -------------------------------------------------------------------------------- 1 | readables/key/wallsign01 2 | { 3 | precache 4 | "num_pages" : "1" 5 | "page1_title" : 6 | { 7 | "this is a title" 8 | } 9 | "page1_body" : 10 | { 11 | "this is a body" 12 | } 13 | "gui_page1" : "guis/readables/marble.gui" 14 | "snd_page_turn" : "readable_page_turn" 15 | } -------------------------------------------------------------------------------- /assets/xdata/logs_shock.xd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hankmorgan/UnderworldExporter/64f5c2310e95c2e507725b9c69955e645b80de0b/assets/xdata/logs_shock.xd -------------------------------------------------------------------------------- /fbxExport.h: -------------------------------------------------------------------------------- 1 | #ifndef fbxexport_h 2 | #define fbxexport_h 3 | //#include 4 | //#include "tilemap.h" 5 | void FBXExport(); 6 | void RenderFBXLevel(tile LevelInfo[64][64], ObjectItem objList[1600], int game); 7 | 8 | 9 | #endif -------------------------------------------------------------------------------- /gamepaths.txt: -------------------------------------------------------------------------------- 1 | C:\Games\uwdemo 2 | c:\games\uw1 3 | c:\games\uw2 4 | C:\Games\systemshock 5 | c:\sourceengine -------------------------------------------------------------------------------- /gamestrings.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hankmorgan/UnderworldExporter/64f5c2310e95c2e507725b9c69955e645b80de0b/gamestrings.cpp -------------------------------------------------------------------------------- /gamestrings.h: -------------------------------------------------------------------------------- 1 | #ifndef gamestrings_h 2 | #define gamestrings_h 3 | 4 | 5 | void unpackStrings(int game); 6 | void unpackStringsShock(char filePath[255]); 7 | 8 | struct huffman_node 9 | { 10 | int symbol; // symbol in node 11 | int parent; // 12 | int left; // -1 when no node 13 | int right; // 14 | }; 15 | 16 | 17 | struct block_dir 18 | { 19 | int block_no; 20 | int address; 21 | int NoOfEntries; 22 | int blockEnd; 23 | } ; 24 | 25 | 26 | void unpackStrings(int game, char filePath[255]); 27 | void unpackStringsShock(char filePath[255]); 28 | 29 | #endif /*gamestrings*/ -------------------------------------------------------------------------------- /light theory updated.txt: -------------------------------------------------------------------------------- 1 | Values at offset +24 and +25 of the subclass define the possible values of the shade adjustments. N 2 | 3 | Lighting Operations are stored in offset +16 4 | (badly eyeballed) 5 | 6 | 00= On and off. 7 | 01= Light pulses on and off 8 | 02= ditto 9 | 04= ditto 10 | 11 | 12 | If appears the +24 and +25 offsets control the upper and lower shade adjustments in nibbles. There may be a bit flag here though 13 | as the behaviour is not always as expected for the values entered. -------------------------------------------------------------------------------- /materials.h: -------------------------------------------------------------------------------- 1 | #ifndef materials_h 2 | #define materials_h 3 | 4 | void BuildXDataFile(int game); 5 | void BuildSndShaderFiles(); 6 | void BuildSHOCKMtrFiles(int MtrType); 7 | void BuildGuiFiles(); 8 | void ExportModelFormat(); 9 | void BuildWORDSXData(int game); 10 | void BuildUWXData(int game, int TargetBlock); 11 | void BuildUWMtrFiles(int game, int mtrType); 12 | void BuildParticles(int game); 13 | #endif /*materials_h*/ -------------------------------------------------------------------------------- /player_dat (uw1).xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hankmorgan/UnderworldExporter/64f5c2310e95c2e507725b9c69955e645b80de0b/player_dat (uw1).xls -------------------------------------------------------------------------------- /scd_ark research file.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hankmorgan/UnderworldExporter/64f5c2310e95c2e507725b9c69955e645b80de0b/scd_ark research file.xls -------------------------------------------------------------------------------- /scd_ark.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hankmorgan/UnderworldExporter/64f5c2310e95c2e507725b9c69955e645b80de0b/scd_ark.xls -------------------------------------------------------------------------------- /scripting.h: -------------------------------------------------------------------------------- 1 | #ifndef scripting_h 2 | #define scripting_h 3 | void buildScriptsUW(int game, tile LevelInfo[64][64], ObjectItem objList[1600], int LevelNo, char Script_Final_File[255]); 4 | void EMAILScript(char objName[80], ObjectItem currObj, int logChunk); 5 | void scriptChainFunctionsUW(int game, ObjectItem objList[1600], ObjectItem currObj, int *conditionalCount, int *TriggerTargetX, int *TriggerTargetY, int *TriggerQuality, int *TriggerFlags, int *TriggerHomeX, int *TriggerHomeY, int scriptLevelNo); 6 | void BuildScriptsShock(int game, tile LevelInfo[64][64], ObjectItem objList[1600], int LevelNo, char Script_Final_File[255]); 7 | void addGlobal(int varIndex); 8 | #endif scripting_h -------------------------------------------------------------------------------- /spell effects.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hankmorgan/UnderworldExporter/64f5c2310e95c2e507725b9c69955e645b80de0b/spell effects.xls -------------------------------------------------------------------------------- /ss1 animations list 1.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hankmorgan/UnderworldExporter/64f5c2310e95c2e507725b9c69955e645b80de0b/ss1 animations list 1.xls -------------------------------------------------------------------------------- /textures.h: -------------------------------------------------------------------------------- 1 | #ifndef textures_h 2 | #define textures_h 3 | 4 | #define CAULK -1 5 | #define VISPORTAL -2 6 | #define NODRAW -3 7 | #define TRIGGER_MULTI -4 8 | #define COLLISION -5 9 | 10 | typedef struct texture 11 | { 12 | int textureNo; //internal texture no. 13 | char path[80]; //Texture Path 14 | short type; //wall=0;floor=1;ceiling=2 may not need? 15 | char desc[80]; 16 | 17 | float align1_1; 18 | float align1_2; 19 | float align1_3; 20 | 21 | float align2_1; 22 | float align2_2; 23 | float align2_3; 24 | 25 | 26 | float floor_align1_1; 27 | float floor_align1_2; 28 | float floor_align1_3; 29 | 30 | float floor_align2_1; 31 | float floor_align2_2; 32 | float floor_align2_3; 33 | 34 | 35 | short water; 36 | short lava; 37 | short ladder; 38 | } texture; 39 | 40 | 41 | extern texture *textureMasters; 42 | 43 | #endif /* textures_h */ -------------------------------------------------------------------------------- /underworld spells.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hankmorgan/UnderworldExporter/64f5c2310e95c2e507725b9c69955e645b80de0b/underworld spells.xls -------------------------------------------------------------------------------- /uw1_config.txt: -------------------------------------------------------------------------------- 1 | ;This is a comment 2 | ;[settings] 3 | ; 4 | ; 5 | NoOfTextures=160; 6 | NoOfObjects=100; 7 | ;This are the textures section 8 | ;Structure is texture Id no (matches game texture id). 9 | ;texture description (from game strings) 10 | ;equivilent texture. 11 | ;delimiter is a 12 | ; 13 | [textures] 14 | tex_001= 1, "a stone wall", "texture path" 15 | 16 | 17 | ; 18 | ;This is the objects section 19 | ;Structure is object id no 20 | ;Object type (entity or model) 21 | ;Object class (helps define how it's data is parsed) 22 | ;Object model path 23 | ; 24 | ;[objects] 25 | ;1 26 | ;{ 27 | ;"model" 28 | ;"treasure" 29 | ;"path to model" 30 | ;} 31 | ;2 32 | ;{ 33 | ;"entity" 34 | ;"npc" 35 | ;"path to model" 36 | ;} -------------------------------------------------------------------------------- /uw1_entrances.txt: -------------------------------------------------------------------------------- 1 | LevelNo TileX TileY 2 | 1 7 38 3 | 1 47 53 4 | 1 35 20 5 | 2 25 10 6 | 2 42 61 7 | 0 26 20 8 | 0 8 34 9 | 2 5 2 --------------------------------------------------------------------------------