Very bad implementation of shop and grenade
This commit is contained in:
parent
e9f4c6e5f8
commit
3868af29e3
13 changed files with 166 additions and 3 deletions
|
|
@ -5,3 +5,11 @@ extends Button
|
|||
func _ready() -> void:
|
||||
icon = weapon.preview
|
||||
text = str(weapon.cost)
|
||||
|
||||
func _pressed() -> void:
|
||||
var player_data = Session.get_player_data()
|
||||
if player_data["money"] >= weapon.cost:
|
||||
var player: Player = Session.player_nodes[multiplayer.get_unique_id()]
|
||||
|
||||
player_data["money"] -= weapon.cost
|
||||
player.get_node("WeaponSystem").add(weapon.weapon_system_scene.instantiate(),"ability_first")
|
||||
|
|
|
|||
30
scenes/weapons/molik.tscn
Normal file
30
scenes/weapons/molik.tscn
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://b6qahd6q60js7"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://y1s64ppporww" path="res://scripts/weapon_system/molikman/molik/molik.gd" id="1_aqokr"]
|
||||
|
||||
[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_aqokr"]
|
||||
bounce = 0.53
|
||||
|
||||
[sub_resource type="SphereMesh" id="SphereMesh_fwcyt"]
|
||||
radius = 0.05
|
||||
height = 0.1
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_aqokr"]
|
||||
radius = 0.05
|
||||
|
||||
[node name="Molik" type="RigidBody3D"]
|
||||
collision_layer = 8
|
||||
physics_material_override = SubResource("PhysicsMaterial_aqokr")
|
||||
gravity_scale = 0.25
|
||||
continuous_cd = true
|
||||
contact_monitor = true
|
||||
max_contacts_reported = 2
|
||||
script = ExtResource("1_aqokr")
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||
mesh = SubResource("SphereMesh_fwcyt")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
shape = SubResource("SphereShape3D_aqokr")
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
||||
24
scenes/weapons/molikman_molik.tscn
Normal file
24
scenes/weapons/molikman_molik.tscn
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://c5q7e5dj86187"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://e6lqknfl4ngt" path="res://scripts/weapon_system/weapon_substate_machine.gd" id="1_e53aq"]
|
||||
[ext_resource type="Script" uid="uid://js2rkse5mka0" path="res://scripts/weapon_system/molikman/molik/intro_state.gd" id="2_8q75j"]
|
||||
[ext_resource type="Script" uid="uid://cnre3f01a2n88" path="res://scripts/weapon_system/molikman/molik/idle_state.gd" id="3_p1i4u"]
|
||||
[ext_resource type="Script" uid="uid://b6eio68csxw7v" path="res://scripts/weapon_system/molikman/molik/throw.gd" id="4_1la3w"]
|
||||
|
||||
[node name="MolikmanMolik" type="Node" node_paths=PackedStringArray("enter_state")]
|
||||
script = ExtResource("1_e53aq")
|
||||
animation_prefix = &"baked_sp_"
|
||||
visibility_target = &"sp"
|
||||
max_ammo = 3
|
||||
ammo_mags = 0
|
||||
enter_state = NodePath("Intro")
|
||||
metadata/_custom_type_script = "uid://e6lqknfl4ngt"
|
||||
|
||||
[node name="Intro" type="Node" parent="."]
|
||||
script = ExtResource("2_8q75j")
|
||||
|
||||
[node name="Idle" type="Node" parent="."]
|
||||
script = ExtResource("3_p1i4u")
|
||||
|
||||
[node name="Throw" type="Node" parent="."]
|
||||
script = ExtResource("4_1la3w")
|
||||
Loading…
Add table
Add a link
Reference in a new issue